skyed 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7912136f81571d2da9daeddeb6dc1f093189bd0e
4
- data.tar.gz: 0b46d44685062f11b9dc683ee05624a06c2682ba
3
+ metadata.gz: e4940c6e2a8a3df68f9e3f68acd1aa8fdae2b12f
4
+ data.tar.gz: 869c118fc70c08c7af21923620e858f5a7c35ffc
5
5
  SHA512:
6
- metadata.gz: f7c719e2f13638225df86460c39cdb22492c28e66fa9c5f636f978ab07c5b79c526fa97ad26860b2227df93bf63d01f68e5ac8d88ba5e46b1eebbe951bf6188e
7
- data.tar.gz: 9ffdc009e20fad9e3b58bcf41ca754fc3b236609efc3c44cc82f030d2c6a7d56b177d260beb9ffcf12c5df95a5367e3a74ca1e891cda006985817e6882e5ce83
6
+ metadata.gz: 6ebb691ec6afb34527190e04ec6fc967faf76ae8cbc712746f5d1b2c9b67ea82ca6045265abbcbaedf0f7e3f0d22ae41012bc4e2399357a713a743ec331f2a43
7
+ data.tar.gz: f81af1bd091b21664c915e84a8ddd8b41e1629f7f572cf97168983a327baf5800249b8cc6c0c718ac51ac09573402f8cf44a2bb0c66d01a94ad03c65369b919f
@@ -5,16 +5,23 @@ module Skyed
5
5
  # This module encapsulates all the Git features.
6
6
  module Git
7
7
  class << self
8
+ def clone_cmd(stack, path)
9
+ cmd = 'export GIT_SSH=/tmp/ssh-git; '
10
+ cmd += 'git clone --branch '
11
+ cmd += stack[:custom_cookbooks_source][:revision]
12
+ cmd += " #{stack[:custom_cookbooks_source][:url]} "
13
+ cmd += path
14
+ cmd
15
+ end
16
+
8
17
  def clone_stack_remote(stack, options)
9
18
  unless Skyed::Settings.current_stack?(stack[:stack_id])
10
19
  Skyed::Init.opsworks_git_key options
11
20
  end
12
21
  ENV['PKEY'] ||= Skyed::Settings.opsworks_git_key
13
- Skyed::Utils.create_template('/tmp', 'ssh-git', 'ssh-git.erb')
14
- File.chmod(0755, '/tmp/ssh-git')
15
- ENV['GIT_SSH'] = '/tmp/ssh-git'
22
+ Skyed::Utils.create_template('/tmp', 'ssh-git', 'ssh-git.erb', 0755)
16
23
  path = "/tmp/skyed.#{SecureRandom.hex}"
17
- ::Git.clone(stack[:custom_cookbooks_source][:url], path)
24
+ `#{clone_cmd(stack, path)}`
18
25
  path
19
26
  end
20
27
  end
@@ -79,7 +79,7 @@ module Skyed
79
79
  else
80
80
  recipes = args.select { |recipe| recipe_in_cookbook(recipe) }
81
81
  end
82
- msg = "Couldn't found #{args - recipes} recipes in repository"
82
+ msg = "Couldn't find #{args - recipes} recipes in repository"
83
83
  fail msg unless recipes == args
84
84
  recipes
85
85
  end
@@ -9,17 +9,17 @@ module Skyed
9
9
  ENV['AWS_SECRET_KEY'] = Skyed::Settings.secret_key
10
10
  end
11
11
 
12
- def create_template(base, subpath, template_file)
12
+ def create_template(base, subpath, template_file, mode = 0644)
13
13
  b = binding
14
14
  folders = subpath.split('/')
15
- template = ERB.new(
16
- File.read(File.join(
17
- File.dirname(File.dirname(File.dirname(__FILE__))),
18
- 'templates',
19
- template_file)))
15
+ template = ERB.new(File.read(File.join(
16
+ File.dirname(File.dirname(File.dirname(__FILE__))),
17
+ 'templates',
18
+ template_file)))
20
19
  File.open(File.join(base, folders), 'w') do |f|
21
20
  f.write(template.result b)
22
21
  end
22
+ File.chmod(mode, File.join(base, folders))
23
23
  end
24
24
 
25
25
  def read_key_file(key_file)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skyed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignasi Fosch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-30 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git