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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31f094cf61c13ab0c20c6aa4a5f3db8ddab4ce13
4
- data.tar.gz: 6c0f25c24201dd8c78a27bff8134e3301d0df237
3
+ metadata.gz: 0ba8266c86870a9a053d2e1f3de4983649ec0488
4
+ data.tar.gz: ee6022c06aa7103f2420b7d6fc2082e022880b8c
5
5
  SHA512:
6
- metadata.gz: b058541f1bbbfe9ef5673585741c881c7075c05e74417ffe4222fd91c06d73c85010a7e0fe072bfdca274d9260b940355c9c219a1d2989b227c16a91ece5bda6
7
- data.tar.gz: 906f67905dcf24afd4a4978d10e87dbe46d0df0123e6c699792eab3daa03c1c1ef19009aa3664c38a82c698a0e50f7be699312cec259a340b925bfbebb3660a7
6
+ metadata.gz: fa4d78b46774227fdda840f11f24499df8404f3c2a856abec249bd1ab8b9c9290f339ed7d8a51d5ae95fb58086c2707c658583bb8cd03e098e68167d59ee5fb0
7
+ data.tar.gz: 571ea6d27b249b36b1f15b5a22c1cc4cf70f1119f2d08db5e94cbe02ec34d9b8218da2fd2b9c5d1e3e0f45d42c659ea5b1232c0c2ae999099d5dfafefe815724
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.5
1
+ 1.2.0
@@ -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') { raise "set SHIPYARD= to your docker host/scope" }
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
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipwright
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hunter