kite 1.0.6 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bafcba5f92cf0a9a3c54b6a2b9584de41fcfb3d96ac61c4dd52bca331f162eb
4
- data.tar.gz: 33595861bc5169202cf792823a93462c082e5d889f84454063f62028f42bdb4d
3
+ metadata.gz: ae6d1e9376c8edcf74e30027c1f56d47e6b76f72c67e5350e03a4d734f1fd1a1
4
+ data.tar.gz: 5c6422da9834fe7d836faf6776d4aebfa51f92672aff4b48c964b8c6f45b962b
5
5
  SHA512:
6
- metadata.gz: 38f218a1d34984f5e7309f501a7e1a8222b3eb88fdc074de3c7cead49a80a6b1ca8cf5939ddeb6bc8478117cff77a76801a8647c3dd7f2ae753dc7af98afc536
7
- data.tar.gz: 993670b0ec2524bf275206f3845a5865d448d334418a2aae522aa79841e23a882eed0e7798cf9dd80f31da7d8b4adf1caed0c1c3ccae68dc9456ae4720d196a1
6
+ metadata.gz: 359dc979574e1eb9022121663e6bd0bb5e64bce5b9c0e7bbd2e13997a043dbbb1dabbdb397f437df1d7cff6d7892a63d5d5aff4dfe21b8b71b3b2fd0919bbbe6
7
+ data.tar.gz: 48f6a76936e0f1b22fdf02e3568a32bb53cfff4dbe3d3c42f1fddbe85a1af9e782352114d2cc12956df4ae9a2b272aaec1832a5b765544a7acfa8b85f8723ab6
data/Dockerfile CHANGED
@@ -1,6 +1,8 @@
1
1
  FROM ruby:2.4-stretch
2
2
 
3
- RUN apt-get update && apt-get install -y zip curl wget
3
+ RUN apt-get update && \
4
+ apt-get upgrade -qqy && \
5
+ apt-get install -y zip curl wget vim
4
6
 
5
7
  ARG TERRAFORM_VERSION=0.11.6
6
8
  ARG BOSH_VERSION=2.0.48
@@ -8,8 +10,8 @@ ARG GCLOUD_VERSION=196.0.0
8
10
 
9
11
  # Install Terraform
10
12
  RUN curl -Ls https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o terraform.zip \
11
- && unzip terraform -d /usr/bin/terraform \
12
- && chmod +x /usr/bin/terraform \
13
+ && unzip terraform.zip \
14
+ && mv terraform /usr/local/bin/terraform \
13
15
  && rm -f terraform.zip
14
16
 
15
17
  # Install BOSH v2
@@ -19,7 +19,7 @@ module Kite
19
19
  desc 'terraform', 'Run Terraform-related commands with environment variables loaded from module vars'
20
20
  method_option :env, type: :string, desc: "Environment", required: true, default: ENV['KITE_ENV']
21
21
  def terraform(command, *args)
22
- Kite::Terraform.new(self, options).run(command, *args)
22
+ Kernel.exit Kite::Terraform.new(self, options).run(command, *args)
23
23
  end
24
24
 
25
25
  desc "version", "Return kite version"
@@ -42,7 +42,7 @@ module Kite
42
42
  append_to_file 'config/cloud.yml', "\n#{name}:\n <<: *default\n"
43
43
  end
44
44
 
45
- @cloud = parse_cloud_config[name]
45
+ @cloud = parse_cloud_config(name)
46
46
  @env_name = name
47
47
 
48
48
  directory("#{options[:provider]}/environment", "config/environments/#{name}")
@@ -5,10 +5,16 @@ module Kite::Helpers
5
5
  end
6
6
 
7
7
  # Parse config/cloud.yml, returning the output hash
8
- def parse_cloud_config
8
+ def parse_cloud_config(env = nil)
9
9
  cloud_config = YAML.load(File.read('config/cloud.yml'))
10
10
  check_cloud_config(cloud_config)
11
11
 
12
- cloud_config
12
+ if env
13
+ unless cloud_config[env]
14
+ fail "Environement `#{env}` missing in config/cloud.yml"
15
+ end
16
+ return cloud_config[env]
17
+ end
18
+ return cloud_config
13
19
  end
14
20
  end
@@ -9,7 +9,7 @@ module Kite
9
9
  @env = options[:env]
10
10
  @path = path
11
11
  @name = path.gsub(/(.*:|.git)/, '').split('/').last
12
- @cloud = parse_cloud_config[@env]
12
+ @cloud = parse_cloud_config(@env)
13
13
  @version = options[:version]
14
14
 
15
15
  unless File.exist? path
@@ -36,7 +36,7 @@ module Kite
36
36
  @name = @path.split('/').last
37
37
  @env = options[:env]
38
38
  @vars = load_vars
39
- @cloud = parse_cloud_config[@env]
39
+ @cloud = parse_cloud_config(@env)
40
40
 
41
41
  say "Rendering files"
42
42
  render_templates
@@ -7,6 +7,7 @@ module Kite
7
7
  end
8
8
 
9
9
  def run(command, *args)
10
+ exit_status = 0
10
11
  STDERR.puts "Loading env"
11
12
  load_env
12
13
  script = "terraform #{command} #{args.join " "}"
@@ -14,7 +15,9 @@ module Kite
14
15
 
15
16
  Dir.chdir("config/environments/#{@env_name}") do
16
17
  system(script)
18
+ exit_status = $?.exitstatus
17
19
  end
20
+ exit_status
18
21
  end
19
22
 
20
23
  def load_env
@@ -1,3 +1,3 @@
1
1
  module Kite
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.10'
3
3
  end
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake
2
+
3
+ ENV['KITE_ENV'] ||= 'development'
4
+
5
+ Dir.glob('lib/tasks/*.rake').each do |task|
6
+ load task
7
+ end
@@ -0,0 +1,26 @@
1
+
2
+ def for_each_submodule &block
3
+ status = %x{git submodule status}
4
+ status.each {|line| yield line.split()[1] }
5
+ end
6
+
7
+ def for_each_submodule_dir &block
8
+ for_each_submodule { |dir| Dir.chdir(dir) { yield dir } }
9
+ end
10
+
11
+ def get_branch(status = `git status`)
12
+ branch = nil
13
+ if match = Regexp.new("^# On branch (.*)").match(status)
14
+ branch = match[1]
15
+ end
16
+ end
17
+
18
+ namespace :git do
19
+
20
+ desc "Update submodules"
21
+ task :update do
22
+ %x{git submodule init}
23
+ %x{git submodule update}
24
+ end
25
+
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Bellet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2018-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -191,9 +191,11 @@ files:
191
191
  - tpl/service/docs/service.md
192
192
  - tpl/skel/Gemfile.tt
193
193
  - tpl/skel/README.md.tt
194
+ - tpl/skel/Rakefile.tt
194
195
  - tpl/skel/bin/kite
195
196
  - tpl/skel/config/cloud.yml
196
197
  - tpl/skel/lib/tasks/.keep
198
+ - tpl/skel/lib/tasks/git.rake
197
199
  - tpl/skel/log/.keep
198
200
  - tpl/skel/tmp/.keep
199
201
  homepage: http://www.heliostech.fr
@@ -215,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
217
  version: '0'
216
218
  requirements: []
217
219
  rubyforge_project:
218
- rubygems_version: 2.7.6
220
+ rubygems_version: 2.7.3
219
221
  signing_key:
220
222
  specification_version: 4
221
223
  summary: Command line tool for devops scaffolding.