shipwright 1.2.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/shipwright/elastic_beanstalk/dockerrun.rb +51 -0
- data/lib/shipwright/elastic_beanstalk.rb +2 -9
- data/lib/shipwright.rb +1 -0
- data/shipwright.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e44c35d9884464043334b20bbfe06005f3673fc3
|
4
|
+
data.tar.gz: d5f30bb8905753f17571925c047ed05a0df0229d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a4a5912fcabc6f55155c6d3614301a38452c7b848b9e6e68bfd2ba52091e290ea1c43c7977482fc4285e3a9e33a4fbc14ccb29e9e25374ba29c3d38f153d63
|
7
|
+
data.tar.gz: 59359e0de1c9097aedcecd2e170c017eacf9a6ad108d88cad89992b4bb85f5cbe1b0042a92fd809b2006e49b9c84da00d5ca01ea9db822162df08c8ad4aeec72
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Shipwright
|
2
|
+
module ElasticBeanstalk
|
3
|
+
class Dockerrun
|
4
|
+
attr_accessor :path, :version
|
5
|
+
|
6
|
+
def initialize(path, version)
|
7
|
+
self.path, self.version = path, version
|
8
|
+
end
|
9
|
+
|
10
|
+
def json
|
11
|
+
@json ||= JSON.parse(File.read(path))
|
12
|
+
end
|
13
|
+
|
14
|
+
def run_version
|
15
|
+
json.fetch('AWSEBDockerrunVersion')
|
16
|
+
end
|
17
|
+
|
18
|
+
def update!
|
19
|
+
if respond_to?("update_#{run_version}")
|
20
|
+
send("update_#{run_version}")
|
21
|
+
else
|
22
|
+
invalid_version_error!
|
23
|
+
end
|
24
|
+
File.open(path, 'wb') { |file| file.write JSON.pretty_generate(json) }
|
25
|
+
end
|
26
|
+
|
27
|
+
def update_1
|
28
|
+
json['Image']['Name'] = image(json['Image']['Name'])
|
29
|
+
end
|
30
|
+
|
31
|
+
def update_2
|
32
|
+
json['containerDefinitions'].each do |container|
|
33
|
+
container['image'] = image(container['image'])
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def image(name)
|
38
|
+
bits = name.to_s.split(':').tap(&:pop)
|
39
|
+
bits.push(version).join(':')
|
40
|
+
end
|
41
|
+
|
42
|
+
def invalid_version_error!
|
43
|
+
raise InvalidDockerrunVersionError.new(
|
44
|
+
"invalid AWSEBDockerrunVersion version: #{run_version.inspect}")
|
45
|
+
end
|
46
|
+
|
47
|
+
InvalidDockerrunVersionError = Class.new(StandardError)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
@@ -13,15 +13,8 @@ module Shipwright
|
|
13
13
|
extend self
|
14
14
|
|
15
15
|
def update_dockerrun
|
16
|
-
dockerrun
|
17
|
-
|
18
|
-
dockerrun['containerDefinitions'].each do |container|
|
19
|
-
bits = container['image'].to_s.split(':').tap(&:pop)
|
20
|
-
container['image'] = bits.push(version).join(':')
|
21
|
-
end
|
22
|
-
|
23
|
-
File.open(DOCKERRUN, 'wb') { |file|
|
24
|
-
file.write JSON.pretty_generate(dockerrun) }
|
16
|
+
dockerrun = Dockerrun.new(DOCKERRUN, version)
|
17
|
+
dockerrun.update!
|
25
18
|
end
|
26
19
|
|
27
20
|
def generate_artifact
|
data/lib/shipwright.rb
CHANGED
data/shipwright.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_dependency 'git', '~> 1.2.9'
|
34
34
|
spec.add_dependency 'rubyzip', '~> 1.1.7'
|
35
35
|
|
36
|
-
spec.add_development_dependency "bundler", "~> 1.
|
36
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
37
37
|
spec.add_development_dependency "rake", "~> 10.0"
|
38
38
|
spec.add_development_dependency "rspec", "~> 3.2.0"
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shipwright
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hunter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
103
|
+
version: '1.7'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.7'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- lib/shipwright/builder.rb
|
159
159
|
- lib/shipwright/cli.rb
|
160
160
|
- lib/shipwright/elastic_beanstalk.rb
|
161
|
+
- lib/shipwright/elastic_beanstalk/dockerrun.rb
|
161
162
|
- shipwright.gemspec
|
162
163
|
homepage: https://github.com/tma1/shipwright
|
163
164
|
licenses: []
|