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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/opzworks/commands/berks.rb +9 -31
- data/lib/opzworks/meta.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bdef3feb5b4be06d5c793abfd6dc87c50b3a3db
|
4
|
+
data.tar.gz: 8380aa94b7ef8f1f754c6f50f6d07444afef10f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd04bb03e9460c266a2107a167d0827e4eced5375393ef7cfb72c420779434089f1f1af4f39349535d9300716ccd6b4a2db900929fcd50c404205cbe0173b57d
|
7
|
+
data.tar.gz: 5f0bcea7dda3cc0240c3a523c3ab39a1bc139cd97071e40d6b1b834532999f39afd5de967060c06260a2807304a77be8d96e3f00bafe746a114fd803e9f6f999
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
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 "\
|
90
|
+
puts "\nPackaging the berkshelf".foreground(:blue)
|
91
91
|
run_local <<-BASH
|
92
92
|
cd #{@target_path}
|
93
|
-
berks
|
93
|
+
berks package #{cook_path}/#{cookbook_tarball}
|
94
94
|
BASH
|
95
95
|
|
96
|
-
|
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
|
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(
|
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(
|
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
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.
|
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-
|
12
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|