shipitron 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68328f7af2efc2a7d163280f0bb1613d685d85b09f991cc53061a5286c02c66e
4
- data.tar.gz: a349443e9f92c64101ebc272f44cfd8b5256d69c83b693b303eed1c2c50ff279
3
+ metadata.gz: 8942009b3ccf99e9b14c8676e355c8a8cd22d7def515a2903daf6707e476a235
4
+ data.tar.gz: 3f1d602aebc48bdc3fda47458da830626c964320b621d6d21cf0db08dfef50a1
5
5
  SHA512:
6
- metadata.gz: a226f3113f356b9a475b3b64aeb9d9ccebf8598d56a29ca99e71dbe7df6c00091abdbd35e70f81c9e0913aa014547c487eb66d221249a327b41220eafac09bb9
7
- data.tar.gz: ac68f08e8ef8ba579d081538ac32930c723d324e5b89c3a67c5963ffa762daeb90665e08c80d3e236646dcf4178cf1b9096489f5aabf18f784cb66448cbb16b5
6
+ metadata.gz: 8e0a2d2d5575272eada04e2cb8b836a2a71a5139e992714bec2ba45ed83dd3d0b6c7821eb92e824c4f8bcba9805f707be1b56e65d95b3ad87b69b40403758f5e
7
+ data.tar.gz: 45f1cdf8c7d940e0defc1ef6be4d65f772648b6c7e7d5d8759f3e19043e426d262a435a5e282eb7fd6872536041f02429d1c3822cc78979dbc444c9c53713c7c
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.5.0-alpine3.7 as cache
1
+ FROM ruby:2.5.1-alpine3.7 as cache
2
2
  COPY cache/ /tmp/
3
3
  RUN cd /usr/local/bundle && \
4
4
  ([ -f /tmp/bundler-data.tar.gz ] && \
@@ -13,9 +13,6 @@ RUN addgroup -S shipitron && \
13
13
  addgroup -g 1101 docker && \
14
14
  addgroup shipitron docker
15
15
 
16
- ENV GOSU_VERSION 1.10
17
- ENV DUMB_INIT_VERSION 1.2.0
18
-
19
16
  RUN apk add --no-cache \
20
17
  ca-certificates \
21
18
  openssl \
data/Dockerfile.release CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.5.0-alpine3.7
1
+ FROM ruby:2.5.1-alpine3.7
2
2
  MAINTAINER Ryan Schlesinger <ryan@outstand.com>
3
3
 
4
4
  RUN addgroup -S shipitron && \
@@ -22,7 +22,7 @@ RUN apk add --no-cache \
22
22
 
23
23
  WORKDIR /app
24
24
 
25
- ENV SHIPITRON_VERSION=1.0.1
25
+ ENV SHIPITRON_VERSION=1.1.0
26
26
 
27
27
  RUN gem install shipitron -v ${SHIPITRON_VERSION} && \
28
28
  mkdir -p /home/shipitron/.ssh && \
data/lib/shipitron/cli.rb CHANGED
@@ -34,6 +34,30 @@ module Shipitron
34
34
  end
35
35
  end
36
36
 
37
+ desc 'force_deploy <app>', 'Forces a redeploy of the app'
38
+ option :config_file, default: 'shipitron/config.yml'
39
+ option :secrets_file, default: '~/.config/shipitron/secrets.yml'
40
+ option :debug, type: :boolean, default: false
41
+ def force_deploy(app)
42
+ setup(
43
+ config_file: options[:config_file],
44
+ secrets_file: options[:secrets_file]
45
+ )
46
+
47
+ require 'shipitron/client/force_deploy'
48
+ result = Client::ForceDeploy.call(
49
+ application: app
50
+ )
51
+
52
+ if result.failure?
53
+ result.errors.each do |error|
54
+ Logger.fatal error
55
+ end
56
+ Logger.fatal 'Deploy failed.'
57
+ end
58
+ end
59
+
60
+
37
61
  desc 'server_deploy', 'Server-side component of deploy'
38
62
  option :name, required: true
39
63
  option :repository, required: true
@@ -0,0 +1,57 @@
1
+ require 'shipitron'
2
+ require 'shipitron/ecs_client'
3
+ require 'shipitron/client/load_application_config'
4
+ require 'shipitron/client/fetch_clusters'
5
+ require 'shipitron/client/ensure_deploy_not_running'
6
+
7
+ module Shipitron
8
+ module Client
9
+ class ForceDeploy
10
+ include Metaractor
11
+ include Interactor::Organizer
12
+ include EcsClient
13
+
14
+ required :application
15
+
16
+ organize [
17
+ LoadApplicationConfig,
18
+ FetchClusters,
19
+ EnsureDeployNotRunning
20
+ ]
21
+
22
+ def call
23
+ Logger.info "==> Force deploying #{application}"
24
+
25
+ super
26
+
27
+ context.clusters ||= []
28
+ context.ecs_services ||= []
29
+
30
+ begin
31
+ context.clusters.each do |cluster|
32
+ context.ecs_services.each do |service|
33
+ ecs_client(region: cluster.region).update_service(
34
+ cluster: cluster.name,
35
+ service: service,
36
+ force_new_deployment: true
37
+ )
38
+ end
39
+ end
40
+ rescue Aws::ECS::Errors::ServiceError => e
41
+ fail_with_errors!(messages: [
42
+ "Error: #{e.message}",
43
+ e.backtrace.join("\n")
44
+ ])
45
+ end
46
+
47
+ Logger.info "==> Done"
48
+ end
49
+
50
+ private
51
+ def application
52
+ context.application
53
+ end
54
+
55
+ end
56
+ end
57
+ end
@@ -1,3 +1,3 @@
1
1
  module Shipitron
2
- VERSION = '1.0.1'
2
+ VERSION = '1.1.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.0.1
4
+ version: 1.1.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-04-06 00:00:00.000000000 Z
11
+ date: 2018-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -288,6 +288,7 @@ files:
288
288
  - lib/shipitron/client/deploy_application.rb
289
289
  - lib/shipitron/client/ensure_deploy_not_running.rb
290
290
  - lib/shipitron/client/fetch_clusters.rb
291
+ - lib/shipitron/client/force_deploy.rb
291
292
  - lib/shipitron/client/load_application_config.rb
292
293
  - lib/shipitron/client/load_templates.rb
293
294
  - lib/shipitron/client/register_ecs_task_definitions.rb