shipwright 1.1.5 → 1.2.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/builder.rb +9 -5
- data/lib/shipwright/cli.rb +6 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ba8266c86870a9a053d2e1f3de4983649ec0488
|
4
|
+
data.tar.gz: ee6022c06aa7103f2420b7d6fc2082e022880b8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa4d78b46774227fdda840f11f24499df8404f3c2a856abec249bd1ab8b9c9290f339ed7d8a51d5ae95fb58086c2707c658583bb8cd03e098e68167d59ee5fb0
|
7
|
+
data.tar.gz: 571ea6d27b249b36b1f15b5a22c1cc4cf70f1119f2d08db5e94cbe02ec34d9b8218da2fd2b9c5d1e3e0f45d42c659ea5b1232c0c2ae999099d5dfafefe815724
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
data/lib/shipwright/builder.rb
CHANGED
@@ -7,10 +7,10 @@ module Shipwright
|
|
7
7
|
COMMIT_MESSAGE = "new version %s built by Shipwright #{Shipwright::VERSION}\n
|
8
8
|
[ci skip]"
|
9
9
|
|
10
|
-
attr_accessor :path, :commit_message, :previous_version, :version
|
10
|
+
attr_accessor :path, :commit_message, :previous_version, :version, :shipyard
|
11
11
|
|
12
|
-
def self.build(path)
|
13
|
-
new(path).build
|
12
|
+
def self.build(path, shipyard = nil)
|
13
|
+
new(path).tap { |b| b.shipyard = shipyard }.build
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.bump
|
@@ -31,10 +31,10 @@ module Shipwright
|
|
31
31
|
|
32
32
|
def initialize(path)
|
33
33
|
self.path = path
|
34
|
-
shipyard
|
35
34
|
end
|
36
35
|
|
37
36
|
def build
|
37
|
+
shipyard
|
38
38
|
self.class.init
|
39
39
|
Shipwright.info "Shipwright is building #{path} (at #{self.class.version})"
|
40
40
|
|
@@ -113,7 +113,9 @@ module Shipwright
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def shipyard
|
116
|
-
ENV.fetch('SHIPYARD')
|
116
|
+
@shipyard ||= ENV.fetch('SHIPYARD')
|
117
|
+
rescue KeyError
|
118
|
+
raise MissingShipyardError
|
117
119
|
end
|
118
120
|
|
119
121
|
def application
|
@@ -128,5 +130,7 @@ module Shipwright
|
|
128
130
|
@git ||= Git.open(Dir.pwd)
|
129
131
|
end
|
130
132
|
|
133
|
+
MissingShipyardError = Class.new(StandardError)
|
134
|
+
|
131
135
|
end
|
132
136
|
end
|
data/lib/shipwright/cli.rb
CHANGED
@@ -9,9 +9,12 @@ module Shipwright
|
|
9
9
|
puts "shipwright version: #{Shipwright::VERSION}"
|
10
10
|
end
|
11
11
|
|
12
|
-
desc "build", "Build and push docker image"
|
13
|
-
def build(base=Dir.pwd)
|
14
|
-
Shipwright::Builder.build(base)
|
12
|
+
desc "build [base] [shipyard]", "Build and push docker image"
|
13
|
+
def build(base=Dir.pwd, shipyard=nil)
|
14
|
+
Shipwright::Builder.build(base, shipyard)
|
15
|
+
rescue MissingShipyardError
|
16
|
+
puts "Set SHIPYARD in your environment or pass it to the build command"
|
17
|
+
exit 1
|
15
18
|
end
|
16
19
|
end
|
17
20
|
end
|