http_stub_docker 0.1.0 → 0.1.1

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: e91403cd4f85dea881d8bb8aa357a2d8abff6432
4
- data.tar.gz: c56cdf6e9959ecc71befd19cb214401e8e725352
3
+ metadata.gz: 164006e652b75d61f679a0cdb4fe0b79d2ec6401
4
+ data.tar.gz: 0fe3c173adfb10e2fadf3fcccb9f5400355242ae
5
5
  SHA512:
6
- metadata.gz: '0068a562c753298fedc0e880bd50ce6496e87b1aab087a277dadcf984feb764204d1350a07e0ab50f2145152a14b4a6bfff9ec73c4de91b54376384b0439dbb6'
7
- data.tar.gz: ac2beddceced91b9538d1a4e1637c9fe4693ffc502b60ebabe4388d9c725a90516baec0049ef931522838c7c62d784ac99e74b973fadd9e13efea744d3e6d022
6
+ metadata.gz: 75ea68e3caad5085e84bab6e58ee7b716d121723ba06abef53ac0975216ec47c118902919e5bd77c0f066b0738f689b3483b0abf428fc3935284ceb301345577
7
+ data.tar.gz: e1147f0fd87367a32c26d5976cacd86bd0c292388ef5307c9779f35001592a9a5d3c28044c3a0cbbc882e5067e5ff68510aa1f815e24ef1edb9a190be31ebb31
@@ -2,10 +2,17 @@
2
2
 
3
3
  set -e
4
4
 
5
- APP_NAME=$1
6
- APP_VERSION=$2
7
- AWS_IMAGE_TAG="$AWS_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$APP_NAME:$APP_VERSION"
5
+ if [ "$#" -lt 2 ]; then
6
+ echo "usage: $(basename "$0") NAME TAG [TAGS...]" && exit 1
7
+ fi
8
+
9
+ app_name="$1"
10
+ app_tags="${@:2}"
8
11
 
9
12
  eval $(aws ecr get-login --region "$AWS_REGION")
10
- docker tag "$APP_NAME" "$AWS_IMAGE_TAG"
11
- docker push "$AWS_IMAGE_TAG"
13
+ IFS=' ' read -ra tags <<< "$app_tags"
14
+ for tag in "${tags[@]}"; do
15
+ image_tag="$AWS_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$app_name:$tag"
16
+ docker tag "$app_name" "$image_tag"
17
+ docker push "$image_tag"
18
+ done
@@ -7,7 +7,7 @@ module HttpStubDocker
7
7
 
8
8
  private_constant :DEFAULT_PORT
9
9
 
10
- attr_reader :configurer, :stub_name, :stub_dir, :port, :external_base_uri, :version, :task_prefix
10
+ attr_reader :configurer, :stub_name, :stub_dir, :port, :external_base_uri, :publish_tags, :task_prefix
11
11
 
12
12
  def initialize(args)
13
13
  @port = ENV["port"] || DEFAULT_PORT
@@ -40,7 +40,11 @@ module HttpStubDocker
40
40
  def define_publish_task(args)
41
41
  desc "Publishes the container"
42
42
  task(publish: "#{args.task_prefix}docker:build") do
43
- sh "#{PUBLISH_SCRIPT} #{args.stub_name} #{args.version}"
43
+ begin
44
+ sh "#{PUBLISH_SCRIPT} #{args.stub_name} #{args.publish_tags.join(" ")}"
45
+ rescue RuntimeError
46
+ raise "Error publishing container"
47
+ end
44
48
  end
45
49
  end
46
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_stub_docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - dueckes