shipitron 1.0.1 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +1 -0
- data/.gitattributes +1 -0
- data/.gitignore +1 -0
- data/Dockerfile +28 -8
- data/Dockerfile.release +25 -3
- data/Gemfile +1 -0
- data/README.md +48 -9
- data/build_dev.sh +1 -1
- data/docker-compose.yml +24 -0
- data/lib/shipitron/cli.rb +33 -3
- data/lib/shipitron/client.rb +9 -0
- data/lib/shipitron/client/bootstrap_application.rb +1 -0
- data/lib/shipitron/client/create_ecs_services.rb +1 -0
- data/lib/shipitron/client/deploy_application.rb +1 -0
- data/lib/shipitron/client/ensure_deploy_not_running.rb +2 -1
- data/lib/shipitron/client/fetch_clusters.rb +1 -0
- data/lib/shipitron/client/force_deploy.rb +58 -0
- data/lib/shipitron/client/load_application_config.rb +4 -0
- data/lib/shipitron/client/load_templates.rb +1 -0
- data/lib/shipitron/client/register_ecs_task_definitions.rb +1 -0
- data/lib/shipitron/client/run_ecs_tasks.rb +14 -1
- data/lib/shipitron/docker_image.rb +4 -1
- data/lib/shipitron/find_docker_volume_name.rb +68 -0
- data/lib/shipitron/git_info.rb +57 -0
- data/lib/shipitron/s3_copy.rb +46 -0
- data/lib/shipitron/server/deploy_application.rb +3 -0
- data/lib/shipitron/server/docker/build_image.rb +4 -1
- data/lib/shipitron/server/docker/configure.rb +46 -10
- data/lib/shipitron/server/docker/push_image.rb +3 -0
- data/lib/shipitron/server/docker/run_build_script.rb +17 -10
- data/lib/shipitron/server/download_build_cache.rb +17 -4
- data/lib/shipitron/server/git/clone_local_copy.rb +3 -4
- data/lib/shipitron/server/git/update_cache.rb +1 -0
- data/lib/shipitron/server/run_post_build.rb +40 -1
- data/lib/shipitron/server/transform_cli_args.rb +6 -0
- data/lib/shipitron/server/update_ecs_task_definitions.rb +2 -1
- data/lib/shipitron/server/upload_build_cache.rb +14 -8
- data/lib/shipitron/version.rb +1 -1
- data/scripts/docker-entrypoint.sh +9 -0
- data/shipitron.gemspec +8 -6
- metadata +50 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1f02ed921fdb5107cebc789f0554daac22d275024e50b94f6059d0ab6d996c1
|
4
|
+
data.tar.gz: 65e5fbca1de1090e34178d44244a5e30938b7de80fe17f0ea7b3df9510e54f9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14d5f5e245ab946538ab1aee9b5d88d88fafb7d4baa61c3634d165d42acfcf5a83e0231cc9299f37d37d38da9a96be0dfc04ba77b42499fc36bdcc5acf69980c
|
7
|
+
data.tar.gz: ace846368647ec022343af65af9978f2647aa7113de1795900a18091754e34e26657bd4d4d4be10e60f4bef81baffa886917c79537f834377182eadabb4a704e
|
data/.dockerignore
CHANGED
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
spec/fixtures/test_repo.tgz filter=lfs diff=lfs merge=lfs -text
|
data/.gitignore
CHANGED
data/Dockerfile
CHANGED
@@ -1,35 +1,55 @@
|
|
1
|
-
FROM ruby:2.
|
1
|
+
FROM ruby:2.7.1-alpine as cache
|
2
2
|
COPY cache/ /tmp/
|
3
3
|
RUN cd /usr/local/bundle && \
|
4
4
|
([ -f /tmp/bundler-data.tar.gz ] && \
|
5
5
|
tar -zxf /tmp/bundler-data.tar.gz && \
|
6
6
|
rm /tmp/bundler-data.tar.gz) || true
|
7
7
|
|
8
|
-
FROM ruby:2.
|
9
|
-
|
8
|
+
FROM ruby:2.7.1-alpine
|
9
|
+
LABEL maintainer="Ryan Schlesinger <ryan@outstand.com>"
|
10
10
|
|
11
11
|
RUN addgroup -S shipitron && \
|
12
12
|
adduser -S -G shipitron 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
|
-
openssl \
|
18
|
+
openssl-dev \
|
22
19
|
tini \
|
23
20
|
su-exec \
|
24
21
|
build-base \
|
25
22
|
git \
|
23
|
+
git-lfs \
|
26
24
|
openssh-client \
|
27
25
|
perl \
|
28
26
|
bash \
|
29
27
|
curl \
|
30
28
|
wget \
|
31
|
-
jq
|
29
|
+
jq \
|
30
|
+
cmake
|
31
|
+
|
32
|
+
ENV ECR_CREDENTIAL_HELPER_VERSION 0.4.0
|
33
|
+
RUN cd /usr/local/bin && \
|
34
|
+
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${ECR_CREDENTIAL_HELPER_VERSION}/linux-amd64/docker-credential-ecr-login && \
|
35
|
+
chmod +x docker-credential-ecr-login
|
36
|
+
|
37
|
+
ENV BUILDKIT_VERSION v0.7.2
|
38
|
+
RUN cd /usr/local/bin && \
|
39
|
+
wget -nv https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}/buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz && \
|
40
|
+
tar --strip-components=1 -zxvf buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz bin/buildctl && \
|
41
|
+
chmod +x buildctl && \
|
42
|
+
rm -f buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz
|
43
|
+
|
44
|
+
USER shipitron
|
45
|
+
ENV BUILDX_VERSION v0.4.2
|
46
|
+
RUN cd /home/shipitron && \
|
47
|
+
wget -nv https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64 && \
|
48
|
+
mkdir -p ~/.docker/cli-plugins && \
|
49
|
+
mv buildx-${BUILDX_VERSION}.linux-amd64 ~/.docker/cli-plugins/docker-buildx && \
|
50
|
+
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
32
51
|
|
52
|
+
USER root
|
33
53
|
ENV USE_BUNDLE_EXEC true
|
34
54
|
ENV BUNDLE_GEMFILE /shipitron/Gemfile
|
35
55
|
|
data/Dockerfile.release
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
FROM ruby:2.
|
2
|
-
|
1
|
+
FROM ruby:2.7.1-alpine
|
2
|
+
LABEL maintainer="Ryan Schlesinger <ryan@outstand.com>"
|
3
3
|
|
4
4
|
RUN addgroup -S shipitron && \
|
5
5
|
adduser -S -G shipitron shipitron && \
|
@@ -20,9 +20,31 @@ RUN apk add --no-cache \
|
|
20
20
|
wget \
|
21
21
|
jq
|
22
22
|
|
23
|
+
ENV ECR_CREDENTIAL_HELPER_VERSION 0.4.0
|
24
|
+
RUN cd /usr/local/bin && \
|
25
|
+
wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${ECR_CREDENTIAL_HELPER_VERSION}/linux-amd64/docker-credential-ecr-login && \
|
26
|
+
chmod +x docker-credential-ecr-login
|
27
|
+
|
28
|
+
ENV BUILDKIT_VERSION v0.7.2
|
29
|
+
RUN cd /usr/local/bin && \
|
30
|
+
wget -nv https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}/buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz && \
|
31
|
+
tar --strip-components=1 -zxvf buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz bin/buildctl && \
|
32
|
+
chmod +x buildctl && \
|
33
|
+
rm -f buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz
|
34
|
+
|
35
|
+
USER shipitron
|
36
|
+
ENV BUILDX_VERSION v0.4.2
|
37
|
+
RUN cd /home/shipitron && \
|
38
|
+
wget -nv https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64 && \
|
39
|
+
mkdir -p ~/.docker/cli-plugins && \
|
40
|
+
mv buildx-${BUILDX_VERSION}.linux-amd64 ~/.docker/cli-plugins/docker-buildx && \
|
41
|
+
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
42
|
+
|
43
|
+
USER root
|
44
|
+
|
23
45
|
WORKDIR /app
|
24
46
|
|
25
|
-
ENV SHIPITRON_VERSION=1.
|
47
|
+
ENV SHIPITRON_VERSION=1.3.1
|
26
48
|
|
27
49
|
RUN gem install shipitron -v ${SHIPITRON_VERSION} && \
|
28
50
|
mkdir -p /home/shipitron/.ssh && \
|
data/Gemfile
CHANGED
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:
|
@@ -30,25 +31,63 @@ applications:
|
|
30
31
|
- Add deploy ref key to `shipitron/<app name>/deploy_ref_key`
|
31
32
|
- `docker run -it --rm -v shipitron.yml:/shipitron/config/shipitron.yml outstand/shipitron:<version> deploy <app>`
|
32
33
|
|
34
|
+
### New shipitron config file keys:
|
35
|
+
|
36
|
+
- registry (specifies an alternate docker registry):
|
37
|
+
```yaml
|
38
|
+
---
|
39
|
+
applications:
|
40
|
+
foobar:
|
41
|
+
registry: 12345.dkr.ecr.us-east-1.amazonaws.com
|
42
|
+
```
|
43
|
+
|
44
|
+
- skip_push (shipitron will skip pushing the docker images; use if the build script takes care of this):
|
45
|
+
```yaml
|
46
|
+
---
|
47
|
+
applications:
|
48
|
+
foobar:
|
49
|
+
skip_push: true
|
50
|
+
```
|
51
|
+
Additionally, the build script will receive the named tag in use as `$2`.
|
52
|
+
|
53
|
+
### Containerized tool support
|
54
|
+
Shipitron now supports starting other containers as part of the build process. We're using this to use the aws cli to transfer files to/from s3. Shipitron's task definition needs to have a task scoped docker volume added with the name `shipitron-home`. This volume will be mounted at `/home/shipitron` and should be shared with any new containers:
|
55
|
+
|
56
|
+
```
|
57
|
+
shipitron_home_volume = FindDockerVolumeName.call!(
|
58
|
+
container_name: 'shipitron',
|
59
|
+
volume_search: /shipitron-home/
|
60
|
+
).volume_name
|
61
|
+
|
62
|
+
docker run ... -v #{shipitron_home_volume}:/home/shipitron ...
|
63
|
+
```
|
64
|
+
|
65
|
+
This allows the containers to share data with each other. ECS will automatically clean up the task scoped container.
|
66
|
+
|
67
|
+
If a containerized tool requires access to AWS resources, be sure to pass the `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` to it so it can inherit any task roles.
|
68
|
+
|
33
69
|
## Development
|
34
70
|
|
35
|
-
- `docker volume create --name shipitron_fog`
|
36
71
|
- `./build_dev.sh`
|
37
|
-
- `
|
38
|
-
-
|
39
|
-
- `
|
40
|
-
- `
|
41
|
-
- `
|
72
|
+
- `dev run --rm shipitron_specs` to run specs
|
73
|
+
- Set the application path in the volumes section in `docker-compose.yml`.
|
74
|
+
- `dev run --rm shipitron deploy <app>` to run client side
|
75
|
+
- `dev run --rm shipitron deploy <app> --simulate` to get the arguments for `server_deploy` below
|
76
|
+
- `dev run --rm -v /bin/docker:/bin/docker -v /var/run/docker.sock:/var/run/docker.sock shipitron server_deploy --name dummy-app --repository git@github.com:outstand/dummy-app --bucket outstand-shipitron --image-name outstand/dummy-app --region us-east-1 --cluster-name us-east-1-prod-blue --ecs-task-defs dummy-app --ecs-services dummy-app --build-script shipitron/build.sh --post-builds 'ecs_task:dummy-app,container_name:dummy-app,command:echo postbuild' --ecs-task-def-templates LS0tCmZhbWlseTogZHVtbXktYXBwCmNvbnRhaW5lcl9kZWZpbml0aW9uczoKICAtIG5hbWU6IGR1bW15LWFwcAogICAgaW1hZ2U6IG91dHN0YW5kL2R1bW15LWFwcDp7e3RhZ319CiAgICBtZW1vcnk6IDEyOAogICAgZXNzZW50aWFsOiB0cnVlCiAgICBwb3J0X21hcHBpbmdzOgogICAgICAtIGNvbnRhaW5lcl9wb3J0OiA4MAogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gbmFtZTogU0VSVklDRV84MF9OQU1FCiAgICAgICAgdmFsdWU6IGR1bW15Cg== --ecs-service-templates LS0tCmNsdXN0ZXI6IHt7Y2x1c3Rlcn19CnNlcnZpY2VfbmFtZTogZHVtbXktYXBwCnRhc2tfZGVmaW5pdGlvbjogZHVtbXktYXBwe3tyZXZpc2lvbn19CmRlc2lyZWRfY291bnQ6IHt7Y291bnR9fQojcm9sZToge3tyb2xlfX0KZGVwbG95bWVudF9jb25maWd1cmF0aW9uOgogIG1heGltdW1fcGVyY2VudDogMjAwCiAgbWluaW11bV9oZWFsdGh5X3BlcmNlbnQ6IDUwCg== --debug` to run server side (dummy-app is an example)
|
42
77
|
|
43
78
|
Running a dev version in production:
|
79
|
+
- Update `Shipitron::Client::STARTED_BY`
|
44
80
|
- `docker push outstand/shipitron:dev`
|
45
81
|
- Update config to use `shipitron_task: shipitron-dev`
|
46
|
-
- `
|
82
|
+
- `dev run --rm shipitron deploy <app> --debug`
|
47
83
|
|
48
84
|
To release a new version:
|
49
85
|
- Update the version number in `version.rb` and `Dockerfile.release` and commit the result.
|
50
86
|
- `./build_dev.sh`
|
51
87
|
- `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
|
88
|
+
- `VERSION=<version>`
|
89
|
+
- `docker build -t outstand/shipitron:$VERSION -f Dockerfile.release .`
|
90
|
+
- `docker push outstand/shipitron:$VERSION`
|
91
|
+
- `docker tag outstand/shipitron:$VERSION outstand/shipitron:latest`
|
92
|
+
- `docker push outstand/shipitron:latest`
|
54
93
|
- Update ECS task definition with new version
|
data/build_dev.sh
CHANGED
@@ -20,7 +20,7 @@ trap cleanup EXIT
|
|
20
20
|
build_args=''
|
21
21
|
mkdir -p ${bundler_data_dir}
|
22
22
|
|
23
|
-
docker build -t ${build_image} -f ${dockerfile} ${build_args} .
|
23
|
+
docker build --pull -t ${build_image} -f ${dockerfile} ${build_args} .
|
24
24
|
|
25
25
|
docker run -t --cidfile=${bundler_data_dir}/cidfile -w /usr/local/bundle ${build_image} tar -zcf /tmp/bundler-data.tar.gz .
|
26
26
|
tar_container=$(cat ${bundler_data_dir}/cidfile)
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
version: '3.8'
|
2
|
+
services:
|
3
|
+
shipitron:
|
4
|
+
image: outstand/shipitron:dev
|
5
|
+
volumes:
|
6
|
+
- ~/dev/pages:/app # Set this to the application to be shipitron'd
|
7
|
+
- shipitron-home:/home/shipitron
|
8
|
+
- ~/.config/shipitron:/home/shipitron/.config/shipitron
|
9
|
+
- .:/shipitron
|
10
|
+
shipitron_specs:
|
11
|
+
image: outstand/shipitron:dev
|
12
|
+
command: rspec spec
|
13
|
+
environment:
|
14
|
+
FOG_LOCAL: 'true'
|
15
|
+
working_dir: /shipitron
|
16
|
+
volumes:
|
17
|
+
- fog:/fog
|
18
|
+
- shipitron-home:/home/shipitron
|
19
|
+
- ~/.config/shipitron:/home/shipitron/.config/shipitron
|
20
|
+
- .:/shipitron
|
21
|
+
|
22
|
+
volumes:
|
23
|
+
fog:
|
24
|
+
shipitron-home:
|
data/lib/shipitron/cli.rb
CHANGED
@@ -27,20 +27,47 @@ module Shipitron
|
|
27
27
|
)
|
28
28
|
|
29
29
|
if result.failure?
|
30
|
-
result.
|
30
|
+
result.error_messages.each do |error|
|
31
31
|
Logger.fatal error
|
32
32
|
end
|
33
33
|
Logger.fatal 'Deploy failed.'
|
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.error_messages.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
|
40
64
|
option :repository_branch, default: 'master'
|
65
|
+
option :registry, default: nil
|
41
66
|
option :bucket, required: true
|
67
|
+
option :build_cache_location, default: 'tmp/build-cache.tar.gz'
|
42
68
|
option :image_name, required: true
|
43
69
|
option :named_tag, default: 'latest'
|
70
|
+
option :skip_push, type: :boolean, default: false
|
44
71
|
option :region, required: true
|
45
72
|
option :clusters, type: :array, required: true
|
46
73
|
option :ecs_task_defs, type: :array, required: true
|
@@ -61,9 +88,12 @@ module Shipitron
|
|
61
88
|
application: options[:name],
|
62
89
|
repository_url: options[:repository],
|
63
90
|
repository_branch: options[:repository_branch],
|
91
|
+
registry: options[:registry],
|
64
92
|
s3_cache_bucket: options[:bucket],
|
93
|
+
build_cache_location: options[:build_cache_location],
|
65
94
|
image_name: options[:image_name],
|
66
95
|
named_tag: options[:named_tag],
|
96
|
+
skip_push: options[:skip_push],
|
67
97
|
region: options[:region],
|
68
98
|
clusters: options[:clusters],
|
69
99
|
ecs_task_defs: options[:ecs_task_defs],
|
@@ -80,7 +110,7 @@ module Shipitron
|
|
80
110
|
)
|
81
111
|
|
82
112
|
if result.failure?
|
83
|
-
result.
|
113
|
+
result.error_messages.each do |error|
|
84
114
|
Logger.fatal error
|
85
115
|
end
|
86
116
|
Logger.fatal 'Deploy failed.'
|
@@ -111,7 +141,7 @@ module Shipitron
|
|
111
141
|
)
|
112
142
|
|
113
143
|
if result.failure?
|
114
|
-
result.
|
144
|
+
result.error_messages.each do |error|
|
115
145
|
Logger.fatal error
|
116
146
|
end
|
117
147
|
Logger.fatal 'Bootstrap failed.'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'shipitron'
|
2
|
+
require 'shipitron/client'
|
2
3
|
require 'shipitron/ecs_client'
|
3
4
|
|
4
5
|
# Note: This is a best effort client side check to make sure there
|
@@ -21,7 +22,7 @@ module Shipitron
|
|
21
22
|
begin
|
22
23
|
response = ecs_client(region: cluster.region).list_tasks(
|
23
24
|
cluster: cluster.name,
|
24
|
-
started_by:
|
25
|
+
started_by: Shipitron::Client::STARTED_BY,
|
25
26
|
max_results: 1,
|
26
27
|
desired_status: status
|
27
28
|
)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'shipitron'
|
2
|
+
require 'shipitron/client'
|
3
|
+
require 'shipitron/ecs_client'
|
4
|
+
require 'shipitron/client/load_application_config'
|
5
|
+
require 'shipitron/client/fetch_clusters'
|
6
|
+
require 'shipitron/client/ensure_deploy_not_running'
|
7
|
+
|
8
|
+
module Shipitron
|
9
|
+
module Client
|
10
|
+
class ForceDeploy
|
11
|
+
include Metaractor
|
12
|
+
include Interactor::Organizer
|
13
|
+
include EcsClient
|
14
|
+
|
15
|
+
required :application
|
16
|
+
|
17
|
+
organize [
|
18
|
+
LoadApplicationConfig,
|
19
|
+
FetchClusters,
|
20
|
+
EnsureDeployNotRunning
|
21
|
+
]
|
22
|
+
|
23
|
+
def call
|
24
|
+
Logger.info "==> Force deploying #{application}"
|
25
|
+
|
26
|
+
super
|
27
|
+
|
28
|
+
context.clusters ||= []
|
29
|
+
context.ecs_services ||= []
|
30
|
+
|
31
|
+
begin
|
32
|
+
context.clusters.each do |cluster|
|
33
|
+
context.ecs_services.each do |service|
|
34
|
+
ecs_client(region: cluster.region).update_service(
|
35
|
+
cluster: cluster.name,
|
36
|
+
service: service,
|
37
|
+
force_new_deployment: true
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
rescue Aws::ECS::Errors::ServiceError => e
|
42
|
+
fail_with_errors!(messages: [
|
43
|
+
"Error: #{e.message}",
|
44
|
+
e.backtrace.join("\n")
|
45
|
+
])
|
46
|
+
end
|
47
|
+
|
48
|
+
Logger.info "==> Done"
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
def application
|
53
|
+
context.application
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'shipitron'
|
2
|
+
require 'shipitron/client'
|
2
3
|
require 'shipitron/post_build'
|
3
4
|
|
4
5
|
module Shipitron
|
@@ -11,7 +12,9 @@ module Shipitron
|
|
11
12
|
def call
|
12
13
|
context.repository_url = config.repository
|
13
14
|
context.repository_branch = config.repository_branch
|
15
|
+
context.registry = config.registry
|
14
16
|
context.s3_cache_bucket = config.cache_bucket
|
17
|
+
context.build_cache_location = config.build_cache_location
|
15
18
|
context.image_name = config.image_name
|
16
19
|
context.named_tag = begin
|
17
20
|
if config.named_tag.nil?
|
@@ -20,6 +23,7 @@ module Shipitron
|
|
20
23
|
config.named_tag
|
21
24
|
end
|
22
25
|
end
|
26
|
+
context.skip_push = config.skip_push
|
23
27
|
context.build_script = config.build_script
|
24
28
|
context.post_builds = begin
|
25
29
|
if config.post_builds.nil?
|