shipitron 0.2.0 → 0.2.1
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 +4 -4
- data/Dockerfile.release +2 -1
- data/README.md +6 -3
- data/lib/shipitron/cli.rb +3 -3
- data/lib/shipitron/client/load_application_config.rb +1 -0
- data/lib/shipitron/client/load_templates.rb +3 -1
- data/lib/shipitron/client/run_ecs_tasks.rb +11 -3
- data/lib/shipitron/server/deploy_application.rb +1 -1
- data/lib/shipitron/server/run_post_build.rb +1 -0
- data/lib/shipitron/server/transform_cli_args.rb +1 -1
- data/lib/shipitron/server/update_ecs_services.rb +7 -1
- data/lib/shipitron/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e83f5c7899e1c6504e2a25641a696c88bd4091c
|
|
4
|
+
data.tar.gz: 8e971e38cad347535d1efee0dbd2b8f11fc51713
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd2e50644045a6da76e406840a0ddc7123766911f3ad29635516987544e8e52a38b737b75b1e23fe1520d0b8e5af6af79a3a6166cfb2dca3dd6060b080ff7d83
|
|
7
|
+
data.tar.gz: 526452513f64ffc57f7c74e4b0e7800951a24b60ee07c7d1c02630bc25d607b4d54724fd662850f07ec5efbd260cfb1eece8e97410faf425f4258a1673106f53
|
data/Dockerfile.release
CHANGED
|
@@ -29,13 +29,14 @@ RUN apk add --no-cache ca-certificates gnupg && \
|
|
|
29
29
|
rm -rf /root/.gnupg
|
|
30
30
|
|
|
31
31
|
RUN apk add --no-cache \
|
|
32
|
+
build-base \
|
|
32
33
|
git \
|
|
33
34
|
perl \
|
|
34
35
|
bash
|
|
35
36
|
|
|
36
37
|
WORKDIR /app
|
|
37
38
|
|
|
38
|
-
ENV SHIPITRON_VERSION=0.2.
|
|
39
|
+
ENV SHIPITRON_VERSION=0.2.1
|
|
39
40
|
|
|
40
41
|
RUN gem install shipitron -v ${SHIPITRON_VERSION} && \
|
|
41
42
|
mkdir -p /home/shipitron/.ssh && \
|
data/README.md
CHANGED
|
@@ -28,6 +28,9 @@ applications:
|
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
- Create shipitron.yml file
|
|
31
|
+
- Add needed ssh known hosts to `shipitron/<app name>/git_host_key` in consul k/v
|
|
32
|
+
- Add git ssh deploy key to `shipitron/<app name>/git_deploy_key` in consul k/v
|
|
33
|
+
- Add docker auth config (`~/.docker/config.json` after `docker login`) to `shipitron/<app name>/docker_auth` in consul k/v
|
|
31
34
|
- `docker run -it --rm -v shipitron.yml:/shipitron/config/shipitron.yml outstand/shipitron:<version> deploy <app>`
|
|
32
35
|
|
|
33
36
|
## Development
|
|
@@ -35,9 +38,9 @@ applications:
|
|
|
35
38
|
- `docker volume create --name shipitron_fog`
|
|
36
39
|
- `./build_dev.sh`
|
|
37
40
|
- `docker run -it --rm -v $(pwd):/shipitron -v shipitron_fog:/fog -e FOG_LOCAL=true outstand/shipitron:dev rspec spec` to run specs
|
|
38
|
-
- `docker run -it --rm -v $(pwd):/shipitron outstand/shipitron:dev deploy <app>` to run client side
|
|
39
|
-
- `docker run -it --rm -v $(pwd):/shipitron outstand/shipitron:dev deploy <app> --simulate` to get the arguments for `server_deploy` below
|
|
40
|
-
- `docker run -it --rm --dns 10.10.10.2 -v
|
|
41
|
+
- `docker run -it --rm -v $(pwd):/shipitron -v /path/to/app:/app outstand/shipitron:dev deploy <app>` to run client side
|
|
42
|
+
- `docker run -it --rm -v $(pwd):/shipitron -v /path/to/app:/app outstand/shipitron:dev deploy <app> --simulate` to get the arguments for `server_deploy` below
|
|
43
|
+
- `docker run -it --rm --dns 10.10.10.2 -v $(pwd):/shipitron -v /path/to/app:/app -v /bin/docker:/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v shipitron_fog:/fog -e FOG_LOCAL=true -e CONSUL_HOST=consul outstand/shipitron:dev 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)
|
|
41
44
|
|
|
42
45
|
To release a new version:
|
|
43
46
|
- Update the version number in `version.rb` and `Dockerfile.release` and commit the result.
|
data/lib/shipitron/cli.rb
CHANGED
|
@@ -39,14 +39,14 @@ module Shipitron
|
|
|
39
39
|
desc 'server_deploy', 'Server-side component of deploy'
|
|
40
40
|
option :name, required: true
|
|
41
41
|
option :repository, required: true
|
|
42
|
-
option :
|
|
42
|
+
option :repository_branch, default: 'master'
|
|
43
43
|
option :bucket, required: true
|
|
44
44
|
option :image_name, required: true
|
|
45
45
|
option :region, required: true
|
|
46
46
|
option :cluster_name, required: true
|
|
47
47
|
option :ecs_task_defs, type: :array, required: true
|
|
48
48
|
option :ecs_task_def_templates, type: :array, default: []
|
|
49
|
-
option :ecs_services, type: :array,
|
|
49
|
+
option :ecs_services, type: :array, default: []
|
|
50
50
|
option :ecs_service_templates, type: :array, default: []
|
|
51
51
|
option :build_script, default: nil
|
|
52
52
|
option :post_builds, type: :array
|
|
@@ -61,7 +61,7 @@ module Shipitron
|
|
|
61
61
|
cli_args = Server::TransformCliArgs.call!(
|
|
62
62
|
application: options[:name],
|
|
63
63
|
repository_url: options[:repository],
|
|
64
|
-
repository_branch: options[:
|
|
64
|
+
repository_branch: options[:repository_branch],
|
|
65
65
|
s3_cache_bucket: options[:bucket],
|
|
66
66
|
image_name: options[:image_name],
|
|
67
67
|
region: options[:region],
|
|
@@ -10,6 +10,7 @@ module Shipitron
|
|
|
10
10
|
|
|
11
11
|
def call
|
|
12
12
|
context.repository_url = config.repository
|
|
13
|
+
context.repository_branch = config.repository_branch
|
|
13
14
|
context.s3_cache_bucket = config.cache_bucket
|
|
14
15
|
context.image_name = config.image_name
|
|
15
16
|
context.build_script = config.build_script
|
|
@@ -6,7 +6,7 @@ module Shipitron
|
|
|
6
6
|
include Metaractor
|
|
7
7
|
|
|
8
8
|
required :ecs_task_def_dir
|
|
9
|
-
|
|
9
|
+
optional :ecs_service_dir
|
|
10
10
|
|
|
11
11
|
def call
|
|
12
12
|
context.ecs_task_def_templates = load_templates(ecs_task_def_dir)
|
|
@@ -23,6 +23,8 @@ module Shipitron
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def load_templates(dir)
|
|
26
|
+
return [] if dir.nil?
|
|
27
|
+
|
|
26
28
|
search_path = Pathname.new(dir)
|
|
27
29
|
unless search_path.directory?
|
|
28
30
|
fail_with_error!(
|
|
@@ -17,15 +17,17 @@ module Shipitron
|
|
|
17
17
|
required :image_name
|
|
18
18
|
required :ecs_task_defs
|
|
19
19
|
optional :ecs_task_def_templates
|
|
20
|
-
|
|
20
|
+
optional :ecs_services
|
|
21
21
|
optional :ecs_service_templates
|
|
22
22
|
optional :build_script
|
|
23
23
|
optional :post_builds
|
|
24
24
|
optional :simulate
|
|
25
|
+
optional :repository_branch
|
|
25
26
|
|
|
26
27
|
before do
|
|
27
28
|
context.post_builds ||= []
|
|
28
29
|
context.ecs_task_def_templates ||= []
|
|
30
|
+
context.ecs_services ||= []
|
|
29
31
|
context.ecs_service_templates ||= []
|
|
30
32
|
end
|
|
31
33
|
|
|
@@ -103,8 +105,10 @@ module Shipitron
|
|
|
103
105
|
ary << '--ecs-task-defs'
|
|
104
106
|
ary.concat(context.ecs_task_defs.each {|s| escape(s)})
|
|
105
107
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
unless context.ecs_services.empty?
|
|
109
|
+
ary << '--ecs-services'
|
|
110
|
+
ary.concat(context.ecs_services.each {|s| escape(s)})
|
|
111
|
+
end
|
|
108
112
|
|
|
109
113
|
if context.build_script != nil
|
|
110
114
|
ary.concat ['--build-script', escaped(:build_script)]
|
|
@@ -125,6 +129,10 @@ module Shipitron
|
|
|
125
129
|
ary.concat(context.ecs_service_templates.map {|t| Base64.urlsafe_encode64(t)})
|
|
126
130
|
end
|
|
127
131
|
|
|
132
|
+
unless context.repository_branch.nil?
|
|
133
|
+
ary.concat ['--repository-branch', escaped(:repository_branch)]
|
|
134
|
+
end
|
|
135
|
+
|
|
128
136
|
if simulate?
|
|
129
137
|
Logger.info "server_deploy command: #{ary.join(' ')}"
|
|
130
138
|
else
|
|
@@ -10,15 +10,21 @@ module Shipitron
|
|
|
10
10
|
|
|
11
11
|
required :region
|
|
12
12
|
required :cluster_name
|
|
13
|
-
|
|
13
|
+
optional :ecs_services
|
|
14
14
|
required :ecs_task_defs
|
|
15
15
|
optional :ecs_service_templates
|
|
16
16
|
|
|
17
17
|
before do
|
|
18
|
+
context.ecs_services ||= []
|
|
18
19
|
context.ecs_service_templates ||= []
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
def call
|
|
23
|
+
if ecs_services.empty?
|
|
24
|
+
Logger.info 'No ECS services to update.'
|
|
25
|
+
return
|
|
26
|
+
end
|
|
27
|
+
|
|
22
28
|
Logger.info "Updating ECS services [#{ecs_services.join(', ')}] with task definitions [#{ecs_task_defs.map(&:to_s).join(', ')}]"
|
|
23
29
|
|
|
24
30
|
begin
|
data/lib/shipitron/version.rb
CHANGED
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: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Schlesinger
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-09-
|
|
11
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|