opzworks 0.6.4 → 0.7.0

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
  SHA1:
3
- metadata.gz: 1111296f3cd018dd32d24abc4c0c98c8946460df
4
- data.tar.gz: 44c0079506ae6ef1a6715632e57db8e51d9215c6
3
+ metadata.gz: 6bdef3feb5b4be06d5c793abfd6dc87c50b3a3db
4
+ data.tar.gz: 8380aa94b7ef8f1f754c6f50f6d07444afef10f4
5
5
  SHA512:
6
- metadata.gz: 4131004755aa53588f044d1333ac3b919a9789ea511739ba60a4c0768408db22ba88ff580084a88ccbe2b002e53502fe6b45a5606c35efbc192973bea780f943
7
- data.tar.gz: e37092652e873004a49dae217bdb1cbf652bab1b5689302abb5c0fdf145a6cfab6b701752356b06da430a74afb67eb9f3e248a5d88312c67f7b677620c5186e6
6
+ metadata.gz: fd04bb03e9460c266a2107a167d0827e4eced5375393ef7cfb72c420779434089f1f1af4f39349535d9300716ccd6b4a2db900929fcd50c404205cbe0173b57d
7
+ data.tar.gz: 5f0bcea7dda3cc0240c3a523c3ab39a1bc139cd97071e40d6b1b834532999f39afd5de967060c06260a2807304a77be8d96e3f00bafe746a114fd803e9f6f999
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  changelog
2
2
  =========
3
3
 
4
+ 0.7.0
5
+ -----
6
+ * use `berks package` rather than vendor and archive
7
+ * dump overrides support
8
+
4
9
  0.6.3
5
10
  -----
6
11
  * support for missing Berksfile.lock, such as when starting a new project
@@ -64,16 +64,16 @@ module OpzWorks
64
64
 
65
65
  berks_cook_path = config.berks_base_path || '/tmp'
66
66
  cook_path = "#{berks_cook_path}/#{@project}-#{@branch}"
67
- install_path = cook_path + '/' + "cookbooks-#{@project}-#{@branch}"
68
67
  cookbook_tarball = config.berks_tarball_name || 'cookbooks.tgz'
69
68
  cookbook_upload = cook_path + '/' "#{cookbook_tarball}"
70
69
  s3_bucket = config.berks_s3_bucket || 'opzworks'
71
- overrides = 'overrides'
70
+
71
+ FileUtils.mkdir_p(cook_path) unless File.exist?(cook_path)
72
72
 
73
73
  # berks
74
74
  #
75
75
  unless File.exist?("#{@target_path}/Berksfile.lock")
76
- puts "\nNo Berksfile.lock, running berks install before vendoring".foreground(:blue)
76
+ puts "\nNo Berksfile.lock, running berks install before packaging".foreground(:blue)
77
77
  run_local <<-BASH
78
78
  cd #{@target_path}
79
79
  berks install
@@ -87,40 +87,18 @@ module OpzWorks
87
87
  berks update
88
88
  BASH
89
89
 
90
- puts "\nVendoring the berkshelf".foreground(:blue)
90
+ puts "\nPackaging the berkshelf".foreground(:blue)
91
91
  run_local <<-BASH
92
92
  cd #{@target_path}
93
- berks vendor #{install_path}
93
+ berks package #{cook_path}/#{cookbook_tarball}
94
94
  BASH
95
95
 
96
- # if there's an overrides file, just pull it and stuff the contents into the
97
- # upload repo; the line is assumed to be a git repo. This is done to override
98
- # opsworks templates without destroying the upstream cookbook.
99
- #
100
- # For example, to override the default nginx cookbook's nginx.conf, create a git
101
- # repo with the directory structure nginx/templates/default and place your
102
- # custom nginx.conf.erb in it.
103
- #
104
- if File.file?("#{@target_path}/#{overrides}")
105
- FileUtils.mkdir_p(install_path) unless File.directory?(install_path)
106
- File.open("#{@target_path}/#{overrides}") do |f|
107
- f.each_line do |line|
108
- puts "Copying override #{line}".foreground(:blue)
109
- `cd #{install_path} && git clone #{line}`
110
- end
111
- end
112
- end
113
-
114
- puts 'Committing changes and pushing'.foreground(:blue)
96
+ puts "\nCommitting changes and pushing".foreground(:blue)
115
97
  system "cd #{@target_path} && git commit -am 'berks update'; git push origin #{@branch}"
116
98
 
117
- puts 'Creating tarball of cookbooks'.foreground(:blue)
118
- FileUtils.mkdir_p(cook_path)
119
- run_local "tar czf #{cookbook_upload} -C #{install_path} ."
120
-
121
99
  # upload
122
100
  #
123
- puts 'Uploading to S3'.foreground(:blue)
101
+ puts "\nUploading to S3".foreground(:blue)
124
102
 
125
103
  begin
126
104
  obj = s3.bucket(s3_bucket).object("#{@s3_path}/#{cookbook_tarball}")
@@ -129,7 +107,7 @@ module OpzWorks
129
107
  puts "Caught exception while uploading to S3 bucket #{s3_bucket}: #{e}".foreground(:red)
130
108
  puts 'Cleaning up before exiting'.foreground(:blue)
131
109
  FileUtils.rm(cookbook_upload)
132
- FileUtils.rm_rf(install_path)
110
+ FileUtils.rm_rf(cook_path)
133
111
  abort
134
112
  else
135
113
  puts "Completed successful upload of #{@s3_path}/#{cookbook_tarball} to #{s3_bucket}!".foreground(:green)
@@ -139,7 +117,7 @@ module OpzWorks
139
117
  #
140
118
  puts 'Cleaning up'.foreground(:blue)
141
119
  FileUtils.rm(cookbook_upload)
142
- FileUtils.rm_rf(install_path)
120
+ FileUtils.rm_rf(cook_path)
143
121
  puts 'Done!'.foreground(:green)
144
122
 
145
123
  # update remote cookbooks
data/lib/opzworks/meta.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module OpzWorks
3
- VERSION = '0.6.4'.freeze
3
+ VERSION = '0.7.0'.freeze
4
4
  AUTHORS = ['Grant Heffernan', 'Mapzen'].freeze
5
5
  EMAIL = ['grant@mapzen.com'].freeze
6
6
  DESCRIPTION = 'OpzWorks Utilities'.freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opzworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Heffernan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-30 00:00:00.000000000 Z
12
+ date: 2016-02-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk