shipitron 1.1.0 → 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
  SHA256:
3
- metadata.gz: 8942009b3ccf99e9b14c8676e355c8a8cd22d7def515a2903daf6707e476a235
4
- data.tar.gz: 3f1d602aebc48bdc3fda47458da830626c964320b621d6d21cf0db08dfef50a1
3
+ metadata.gz: 9bd4d376f639bb5ebd80df8a467b8aaca8eac7f2d50ebb6a404683dbaea2fde5
4
+ data.tar.gz: d368aa28072880ae2580ed73fca2c78d40328b497d21d3a1d02139ccdfd77af5
5
5
  SHA512:
6
- metadata.gz: 8e0a2d2d5575272eada04e2cb8b836a2a71a5139e992714bec2ba45ed83dd3d0b6c7821eb92e824c4f8bcba9805f707be1b56e65d95b3ad87b69b40403758f5e
7
- data.tar.gz: 45f1cdf8c7d940e0defc1ef6be4d65f772648b6c7e7d5d8759f3e19043e426d262a435a5e282eb7fd6872536041f02429d1c3822cc78979dbc444c9c53713c7c
6
+ metadata.gz: 26eafd5c78aafa2946e78e400e0c132820ca9b7b57dbbf0846fce2e11f290db649c7257ffb76283fa2bd86176fe38fe322a79077836ef9afd1eaefa306b43a3d
7
+ data.tar.gz: cf99dd7b011c3beb293b428418930f55aa0990a73027deda2c6c1b7e6d420db7b5584af89457acc0a0318553ebc0ed3bc53c3f18d49860c5c947647164f2ea9f
@@ -22,7 +22,7 @@ RUN apk add --no-cache \
22
22
 
23
23
  WORKDIR /app
24
24
 
25
- ENV SHIPITRON_VERSION=1.1.0
25
+ ENV SHIPITRON_VERSION=1.2.0
26
26
 
27
27
  RUN gem install shipitron -v ${SHIPITRON_VERSION} && \
28
28
  mkdir -p /home/shipitron/.ssh && \
data/README.md CHANGED
@@ -9,6 +9,7 @@ applications:
9
9
  dummy-app:
10
10
  repository: git@github.com:outstand/dummy-app
11
11
  cache_bucket: bucket
12
+ build_cache_location: tmp/build-cache.tar.gz
12
13
  image_name: outstand/dummy-app
13
14
  build_script: shipitron/build.sh
14
15
  post_builds:
@@ -51,4 +52,6 @@ To release a new version:
51
52
  - `docker run -it --rm -v ~/.gitconfig:/root/.gitconfig -v ~/.gitconfig.user:/root/.gitconfig.user -v ~/.ssh/id_rsa:/root/.ssh/id_rsa -v ~/.gem:/root/.gem -w /shipitron outstand/shipitron:dev rake release`
52
53
  - `docker build -t outstand/shipitron:VERSION -f Dockerfile.release .`
53
54
  - `docker push outstand/shipitron:VERSION`
55
+ - `docker tag outstand/shipitron:VERSION outstand/shipitron:latest`
56
+ - `docker push outstand/shipitron:latest`
54
57
  - Update ECS task definition with new version
@@ -63,6 +63,7 @@ module Shipitron
63
63
  option :repository, required: true
64
64
  option :repository_branch, default: 'master'
65
65
  option :bucket, required: true
66
+ option :build_cache_location, default: 'tmp/build-cache.tar.gz'
66
67
  option :image_name, required: true
67
68
  option :named_tag, default: 'latest'
68
69
  option :region, required: true
@@ -86,6 +87,7 @@ module Shipitron
86
87
  repository_url: options[:repository],
87
88
  repository_branch: options[:repository_branch],
88
89
  s3_cache_bucket: options[:bucket],
90
+ build_cache_location: options[:build_cache_location],
89
91
  image_name: options[:image_name],
90
92
  named_tag: options[:named_tag],
91
93
  region: options[:region],
@@ -12,6 +12,7 @@ module Shipitron
12
12
  context.repository_url = config.repository
13
13
  context.repository_branch = config.repository_branch
14
14
  context.s3_cache_bucket = config.cache_bucket
15
+ context.build_cache_location = config.build_cache_location
15
16
  context.image_name = config.image_name
16
17
  context.named_tag = begin
17
18
  if config.named_tag.nil?
@@ -16,6 +16,7 @@ module Shipitron
16
16
  required :shipitron_task
17
17
  required :repository_url
18
18
  required :s3_cache_bucket
19
+ required :build_cache_location
19
20
  required :image_name
20
21
  required :named_tag
21
22
  required :ecs_task_defs
@@ -108,6 +109,7 @@ module Shipitron
108
109
  '--name', context.application,
109
110
  '--repository', context.repository_url,
110
111
  '--bucket', context.s3_cache_bucket,
112
+ '--build-cache-location', context.build_cache_location,
111
113
  '--image-name', context.image_name,
112
114
  '--named-tag', context.named_tag,
113
115
  '--region', cluster.region,
@@ -19,6 +19,7 @@ module Shipitron
19
19
  required :application
20
20
  required :repository_url
21
21
  required :s3_cache_bucket
22
+ required :build_cache_location
22
23
  required :docker_image
23
24
  required :named_tag
24
25
  required :region
@@ -8,17 +8,18 @@ module Shipitron
8
8
 
9
9
  required :application
10
10
  required :s3_cache_bucket
11
+ required :build_cache_location
11
12
 
12
13
  def call
13
14
  Logger.info "Downloading build cache from bucket #{s3_cache_bucket}"
14
15
 
15
- s3_file = bucket.files.get("#{application}.build-cache.tar.gz")
16
+ s3_file = bucket.files.get("#{application}.build-cache.archive")
16
17
  if s3_file.nil?
17
18
  Logger.warn 'Build cache not found.'
18
19
  return
19
20
  end
20
21
 
21
- build_cache = Pathname.new("/home/shipitron/#{application}/tmp/build-cache.tar.gz")
22
+ build_cache = Pathname.new("/home/shipitron/#{application}/#{build_cache_location}")
22
23
  build_cache.parent.mkpath
23
24
  build_cache.open('wb') do |local_file|
24
25
  local_file.write(s3_file.body)
@@ -36,6 +37,10 @@ module Shipitron
36
37
  context.s3_cache_bucket
37
38
  end
38
39
 
40
+ def build_cache_location
41
+ context.build_cache_location
42
+ end
43
+
39
44
  def bucket
40
45
  @bucket ||= FetchBucket.call!(name: s3_cache_bucket).bucket
41
46
  end
@@ -13,6 +13,7 @@ module Shipitron
13
13
  required :repository_url
14
14
  optional :repository_branch
15
15
  required :s3_cache_bucket
16
+ required :build_cache_location
16
17
  required :image_name
17
18
  required :named_tag
18
19
  required :region
@@ -37,6 +38,7 @@ module Shipitron
37
38
  repository_url
38
39
  repository_branch
39
40
  s3_cache_bucket
41
+ build_cache_location
40
42
  named_tag
41
43
  region
42
44
  clusters
@@ -8,11 +8,12 @@ module Shipitron
8
8
 
9
9
  required :application
10
10
  required :s3_cache_bucket
11
+ required :build_cache_location
11
12
 
12
13
  def call
13
14
  Logger.info "Uploading build cache to bucket #{s3_cache_bucket}"
14
15
 
15
- build_cache = Pathname.new("/home/shipitron/#{application}/tmp/build-cache.tar.gz")
16
+ build_cache = Pathname.new("/home/shipitron/#{application}/#{build_cache_location}")
16
17
  unless build_cache.exist?
17
18
  Logger.warn 'Build cache not found.'
18
19
  return
@@ -20,7 +21,7 @@ module Shipitron
20
21
 
21
22
  build_cache.open('rb') do |local_file|
22
23
  bucket.files.create(
23
- key: "#{application}.build-cache.tar.gz",
24
+ key: "#{application}.build-cache.archive",
24
25
  body: local_file.read
25
26
  )
26
27
  end
@@ -35,6 +36,10 @@ module Shipitron
35
36
  context.s3_cache_bucket
36
37
  end
37
38
 
39
+ def build_cache_location
40
+ context.build_cache_location
41
+ end
42
+
38
43
  def bucket
39
44
  @bucket ||= FetchBucket.call!(name: s3_cache_bucket).bucket
40
45
  end
@@ -1,3 +1,3 @@
1
1
  module Shipitron
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipitron
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Schlesinger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-03 00:00:00.000000000 Z
11
+ date: 2018-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor