shipitron 1.3.2 → 1.4.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 +4 -4
 - data/.buildkite/pipeline.yml +94 -0
 - data/.rspec +1 -0
 - data/Deskfile +15 -0
 - data/Dockerfile +17 -15
 - data/Dockerfile.release +6 -6
 - data/Dockerfile.staging +70 -0
 - data/Gemfile +1 -0
 - data/README.md +13 -11
 - data/docker-compose.yml +34 -4
 - data/lib/shipitron.rb +19 -2
 - data/lib/shipitron/cli.rb +38 -42
 - data/lib/shipitron/client.rb +3 -3
 - data/lib/shipitron/client/deploy_application.rb +1 -0
 - data/lib/shipitron/client/ensure_deploy_not_running.rb +1 -1
 - data/lib/shipitron/client/generate_deploy.rb +41 -0
 - data/lib/shipitron/client/load_application_config.rb +14 -0
 - data/lib/shipitron/client/run_ecs_tasks.rb +96 -78
 - data/lib/shipitron/server/fetch_deploy.rb +50 -0
 - data/lib/shipitron/server/git/clone_local_copy.rb +1 -1
 - data/lib/shipitron/server/git/update_cache.rb +1 -1
 - data/lib/shipitron/version.rb +1 -1
 - data/scripts/docker-entrypoint.sh +30 -5
 - data/scripts/release-entrypoint.sh +20 -0
 - data/shipitron.gemspec +5 -4
 - data/test.yml +5 -0
 - metadata +32 -12
 - data/build_dev.sh +0 -27
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: ce2ad45258aa11acc35b0c3041aab0fe3f20bb56f076764120f1b6466233f310
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 938b06da85c43614c316c7d63a755440e8d7d61e6396ee0bc574040fda9bd817
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 5a93f308e3065ada355022a5a18977d903e00ae56387e98218bf26557101ca8ccbb1a2d7c1950c6c2849b0bc47da860a57dccb6d0365216df99670a90245ce2c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 2a041845cb6bc87c29366de8e39702fb691bec9efb7a2e53df8673d30bbd9988edaa3147fe68a98c09fe6be80b81aa8a3094ded4fef464df23622c421ea63017
         
     | 
| 
         @@ -0,0 +1,94 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            env:
         
     | 
| 
      
 2 
     | 
    
         
            +
              BUILDKITE_PLUGIN_DOCKER_CACHE_S3_BUCKET: "outstand-buildkite-cache"
         
     | 
| 
      
 3 
     | 
    
         
            +
              # BUILDKITE_PLUGIN_DOCKER_CACHE_VOLUME_DEBUG: "true"
         
     | 
| 
      
 4 
     | 
    
         
            +
              BUILDKITE_PLUGIN_DOCKER_COMPOSE_SHELL: "false"
         
     | 
| 
      
 5 
     | 
    
         
            +
              # BUILDKITE_PLUGIN_DOCKER_COMPOSE_UPLOAD_CONTAINER_LOGS: "always"
         
     | 
| 
      
 6 
     | 
    
         
            +
              BUILDKITE_PLUGIN_DOCKER_COMPOSE_PULL_RETRIES: 5
         
     | 
| 
      
 7 
     | 
    
         
            +
              BUILDKITE_PLUGIN_DOCKER_COMPOSE_PUSH_RETRIES: 5
         
     | 
| 
      
 8 
     | 
    
         
            +
              PLUGIN_DOCKER_COMPOSE_VERSION: "17bac3aaee1360e39381b89bb45513b11838238e"
         
     | 
| 
      
 9 
     | 
    
         
            +
              PLUGIN_DOCKER_CACHE_VERSION: "f3d8feb52a25c69c75565e9f0b80375eae51850a"
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            steps:
         
     | 
| 
      
 12 
     | 
    
         
            +
              - label: ":docker: Build"
         
     | 
| 
      
 13 
     | 
    
         
            +
                key: build
         
     | 
| 
      
 14 
     | 
    
         
            +
                plugins:
         
     | 
| 
      
 15 
     | 
    
         
            +
                  - seek-oss/aws-sm#v2.2.1:
         
     | 
| 
      
 16 
     | 
    
         
            +
                      env:
         
     | 
| 
      
 17 
     | 
    
         
            +
                        DOCKER_LOGIN_PASSWORD: "/buildkite/docker_password"
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                  - docker-login#v2.0.1:
         
     | 
| 
      
 20 
     | 
    
         
            +
                      username: outstandci
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                  - ecr#v2.1.1:
         
     | 
| 
      
 23 
     | 
    
         
            +
                      login: true
         
     | 
| 
      
 24 
     | 
    
         
            +
                      region: "us-east-1"
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                  - https://github.com/outstand/docker-compose-buildkite-plugin.git#${PLUGIN_DOCKER_COMPOSE_VERSION}:
         
     | 
| 
      
 27 
     | 
    
         
            +
                      build: specs
         
     | 
| 
      
 28 
     | 
    
         
            +
                      image-repository: 786715713882.dkr.ecr.us-east-1.amazonaws.com/ci-images
         
     | 
| 
      
 29 
     | 
    
         
            +
                      config:
         
     | 
| 
      
 30 
     | 
    
         
            +
                        - docker-compose.yml
         
     | 
| 
      
 31 
     | 
    
         
            +
                        - test.yml
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              - label: ":bundler: :rubygems:"
         
     | 
| 
      
 34 
     | 
    
         
            +
                key: bundle_install
         
     | 
| 
      
 35 
     | 
    
         
            +
                command: bundle install
         
     | 
| 
      
 36 
     | 
    
         
            +
                depends_on: build
         
     | 
| 
      
 37 
     | 
    
         
            +
                plugins:
         
     | 
| 
      
 38 
     | 
    
         
            +
                  - seek-oss/aws-sm#v2.2.1:
         
     | 
| 
      
 39 
     | 
    
         
            +
                      env:
         
     | 
| 
      
 40 
     | 
    
         
            +
                        DOCKER_LOGIN_PASSWORD: "/buildkite/docker_password"
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                  - docker-login#v2.0.1:
         
     | 
| 
      
 43 
     | 
    
         
            +
                      username: outstandci
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                  - ecr#v2.1.1:
         
     | 
| 
      
 46 
     | 
    
         
            +
                      login: true
         
     | 
| 
      
 47 
     | 
    
         
            +
                      region: "us-east-1"
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                  - https://github.com/outstand/docker-compose-buildkite-plugin.git#${PLUGIN_DOCKER_COMPOSE_VERSION}:
         
     | 
| 
      
 50 
     | 
    
         
            +
                      run: specs
         
     | 
| 
      
 51 
     | 
    
         
            +
                      dependencies: false
         
     | 
| 
      
 52 
     | 
    
         
            +
                      config:
         
     | 
| 
      
 53 
     | 
    
         
            +
                        - docker-compose.yml
         
     | 
| 
      
 54 
     | 
    
         
            +
                        - test.yml
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                  - https://github.com/outstand/docker-cache-buildkite-plugin.git#${PLUGIN_DOCKER_CACHE_VERSION}:
         
     | 
| 
      
 57 
     | 
    
         
            +
                      name: bundler-cache
         
     | 
| 
      
 58 
     | 
    
         
            +
                      keys:
         
     | 
| 
      
 59 
     | 
    
         
            +
                        - v1-bundler-cache-{{ arch }}-{{ checksum "shipitron.gemspec" }}-{{ checksum "Gemfile" }}
         
     | 
| 
      
 60 
     | 
    
         
            +
                        - v1-bundler-cache-{{ arch }}-
         
     | 
| 
      
 61 
     | 
    
         
            +
                      save: true
         
     | 
| 
      
 62 
     | 
    
         
            +
                      volumes:
         
     | 
| 
      
 63 
     | 
    
         
            +
                        - bundler-data
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
              - label: ":ruby: Specs"
         
     | 
| 
      
 66 
     | 
    
         
            +
                command: rspec spec
         
     | 
| 
      
 67 
     | 
    
         
            +
                depends_on: bundle_install
         
     | 
| 
      
 68 
     | 
    
         
            +
                plugins:
         
     | 
| 
      
 69 
     | 
    
         
            +
                  - seek-oss/aws-sm#v2.2.1:
         
     | 
| 
      
 70 
     | 
    
         
            +
                      env:
         
     | 
| 
      
 71 
     | 
    
         
            +
                        DOCKER_LOGIN_PASSWORD: "/buildkite/docker_password"
         
     | 
| 
      
 72 
     | 
    
         
            +
                      json-to-env:
         
     | 
| 
      
 73 
     | 
    
         
            +
                        - secret-id: "/buildkite/rails/env_vars"
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                  - docker-login#v2.0.1:
         
     | 
| 
      
 76 
     | 
    
         
            +
                      username: outstandci
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
                  - ecr#v2.1.1:
         
     | 
| 
      
 79 
     | 
    
         
            +
                      login: true
         
     | 
| 
      
 80 
     | 
    
         
            +
                      region: "us-east-1"
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                  - https://github.com/outstand/docker-compose-buildkite-plugin.git#${PLUGIN_DOCKER_COMPOSE_VERSION}:
         
     | 
| 
      
 83 
     | 
    
         
            +
                      run: specs
         
     | 
| 
      
 84 
     | 
    
         
            +
                      config:
         
     | 
| 
      
 85 
     | 
    
         
            +
                        - docker-compose.yml
         
     | 
| 
      
 86 
     | 
    
         
            +
                        - test.yml
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                  - https://github.com/outstand/docker-cache-buildkite-plugin.git#${PLUGIN_DOCKER_CACHE_VERSION}:
         
     | 
| 
      
 89 
     | 
    
         
            +
                      name: bundler-cache
         
     | 
| 
      
 90 
     | 
    
         
            +
                      keys:
         
     | 
| 
      
 91 
     | 
    
         
            +
                        - v1-bundler-cache-{{ arch }}-{{ checksum "shipitron.gemspec" }}-{{ checksum "Gemfile" }}
         
     | 
| 
      
 92 
     | 
    
         
            +
                        - v1-bundler-cache-{{ arch }}-
         
     | 
| 
      
 93 
     | 
    
         
            +
                      volumes:
         
     | 
| 
      
 94 
     | 
    
         
            +
                        - bundler-data
         
     | 
    
        data/.rspec
    CHANGED
    
    
    
        data/Deskfile
    ADDED
    
    
    
        data/Dockerfile
    CHANGED
    
    | 
         @@ -1,11 +1,6 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            FROM  
     | 
| 
       2 
     | 
    
         
            -
            COPY cache/ /tmp/
         
     | 
| 
       3 
     | 
    
         
            -
            RUN   cd /usr/local/bundle && \
         
     | 
| 
       4 
     | 
    
         
            -
                ([ -f /tmp/bundler-data.tar.gz ] && \
         
     | 
| 
       5 
     | 
    
         
            -
                tar -zxf /tmp/bundler-data.tar.gz && \
         
     | 
| 
       6 
     | 
    
         
            -
                rm /tmp/bundler-data.tar.gz) || true
         
     | 
| 
      
 1 
     | 
    
         
            +
            FROM outstand/fixuid as fixuid
         
     | 
| 
       7 
2 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
            FROM ruby:2.7. 
     | 
| 
      
 3 
     | 
    
         
            +
            FROM ruby:2.7.3-alpine
         
     | 
| 
       9 
4 
     | 
    
         
             
            LABEL maintainer="Ryan Schlesinger <ryan@outstand.com>"
         
     | 
| 
       10 
5 
     | 
    
         | 
| 
       11 
6 
     | 
    
         
             
            RUN addgroup -S shipitron && \
         
     | 
| 
         @@ -29,12 +24,19 @@ RUN apk add --no-cache \ 
     | 
|
| 
       29 
24 
     | 
    
         
             
                jq \
         
     | 
| 
       30 
25 
     | 
    
         
             
                cmake
         
     | 
| 
       31 
26 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 27 
     | 
    
         
            +
            COPY --from=fixuid /usr/local/bin/fixuid /usr/local/bin/fixuid
         
     | 
| 
      
 28 
     | 
    
         
            +
            RUN chmod 4755 /usr/local/bin/fixuid && \
         
     | 
| 
      
 29 
     | 
    
         
            +
                  USER=shipitron && \
         
     | 
| 
      
 30 
     | 
    
         
            +
                  GROUP=shipitron && \
         
     | 
| 
      
 31 
     | 
    
         
            +
                  mkdir -p /etc/fixuid && \
         
     | 
| 
      
 32 
     | 
    
         
            +
                  printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            ENV ECR_CREDENTIAL_HELPER_VERSION 0.5.0
         
     | 
| 
       33 
35 
     | 
    
         
             
            RUN cd /usr/local/bin && \
         
     | 
| 
       34 
36 
     | 
    
         
             
                  wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${ECR_CREDENTIAL_HELPER_VERSION}/linux-amd64/docker-credential-ecr-login && \
         
     | 
| 
       35 
37 
     | 
    
         
             
                  chmod +x docker-credential-ecr-login
         
     | 
| 
       36 
38 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
            ENV BUILDKIT_VERSION v0. 
     | 
| 
      
 39 
     | 
    
         
            +
            ENV BUILDKIT_VERSION v0.8.3
         
     | 
| 
       38 
40 
     | 
    
         
             
            RUN cd /usr/local/bin && \
         
     | 
| 
       39 
41 
     | 
    
         
             
                  wget -nv https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}/buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz && \
         
     | 
| 
       40 
42 
     | 
    
         
             
                  tar --strip-components=1 -zxvf buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz bin/buildctl && \
         
     | 
| 
         @@ -42,7 +44,7 @@ RUN cd /usr/local/bin && \ 
     | 
|
| 
       42 
44 
     | 
    
         
             
                  rm -f buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz
         
     | 
| 
       43 
45 
     | 
    
         | 
| 
       44 
46 
     | 
    
         
             
            USER shipitron
         
     | 
| 
       45 
     | 
    
         
            -
            ENV BUILDX_VERSION v0. 
     | 
| 
      
 47 
     | 
    
         
            +
            ENV BUILDX_VERSION v0.5.1
         
     | 
| 
       46 
48 
     | 
    
         
             
            RUN cd /home/shipitron && \
         
     | 
| 
       47 
49 
     | 
    
         
             
                  wget -nv https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64 && \
         
     | 
| 
       48 
50 
     | 
    
         
             
                  mkdir -p ~/.docker/cli-plugins && \
         
     | 
| 
         @@ -53,16 +55,16 @@ USER root 
     | 
|
| 
       53 
55 
     | 
    
         
             
            ENV USE_BUNDLE_EXEC true
         
     | 
| 
       54 
56 
     | 
    
         
             
            ENV BUNDLE_GEMFILE /shipitron/Gemfile
         
     | 
| 
       55 
57 
     | 
    
         | 
| 
      
 58 
     | 
    
         
            +
            ENV BUNDLER_VERSION 2.2.21
         
     | 
| 
      
 59 
     | 
    
         
            +
            RUN gem install bundler -v ${BUNDLER_VERSION} -i /usr/local/lib/ruby/gems/$(ls /usr/local/lib/ruby/gems) --force
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
       56 
61 
     | 
    
         
             
            WORKDIR /app
         
     | 
| 
       57 
62 
     | 
    
         
             
            COPY Gemfile shipitron.gemspec /shipitron/
         
     | 
| 
       58 
63 
     | 
    
         
             
            COPY lib/shipitron/version.rb /shipitron/lib/shipitron/
         
     | 
| 
       59 
64 
     | 
    
         | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
            RUN (bundle check || bundle install) && \
         
     | 
| 
       62 
     | 
    
         
            -
                  git config --global push.default simple
         
     | 
| 
      
 65 
     | 
    
         
            +
            RUN git config --global push.default simple
         
     | 
| 
       63 
66 
     | 
    
         
             
            COPY . /shipitron/
         
     | 
| 
       64 
     | 
    
         
            -
            RUN  
     | 
| 
       65 
     | 
    
         
            -
                mkdir -p /home/shipitron/.ssh && \
         
     | 
| 
      
 67 
     | 
    
         
            +
            RUN mkdir -p /home/shipitron/.ssh && \
         
     | 
| 
       66 
68 
     | 
    
         
             
                chown shipitron:shipitron /home/shipitron/.ssh && \
         
     | 
| 
       67 
69 
     | 
    
         
             
                chmod 700 /home/shipitron/.ssh
         
     | 
| 
       68 
70 
     | 
    
         | 
    
        data/Dockerfile.release
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            FROM ruby:2.7. 
     | 
| 
      
 1 
     | 
    
         
            +
            FROM ruby:2.7.3-alpine
         
     | 
| 
       2 
2 
     | 
    
         
             
            LABEL maintainer="Ryan Schlesinger <ryan@outstand.com>"
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            RUN addgroup -S shipitron && \
         
     | 
| 
         @@ -21,12 +21,12 @@ RUN apk add --no-cache \ 
     | 
|
| 
       21 
21 
     | 
    
         
             
                jq \
         
     | 
| 
       22 
22 
     | 
    
         
             
                cmake
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
            ENV ECR_CREDENTIAL_HELPER_VERSION 0. 
     | 
| 
      
 24 
     | 
    
         
            +
            ENV ECR_CREDENTIAL_HELPER_VERSION 0.5.0
         
     | 
| 
       25 
25 
     | 
    
         
             
            RUN cd /usr/local/bin && \
         
     | 
| 
       26 
26 
     | 
    
         
             
                  wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${ECR_CREDENTIAL_HELPER_VERSION}/linux-amd64/docker-credential-ecr-login && \
         
     | 
| 
       27 
27 
     | 
    
         
             
                  chmod +x docker-credential-ecr-login
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
            ENV BUILDKIT_VERSION v0. 
     | 
| 
      
 29 
     | 
    
         
            +
            ENV BUILDKIT_VERSION v0.8.3
         
     | 
| 
       30 
30 
     | 
    
         
             
            RUN cd /usr/local/bin && \
         
     | 
| 
       31 
31 
     | 
    
         
             
                  wget -nv https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}/buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz && \
         
     | 
| 
       32 
32 
     | 
    
         
             
                  tar --strip-components=1 -zxvf buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz bin/buildctl && \
         
     | 
| 
         @@ -34,7 +34,7 @@ RUN cd /usr/local/bin && \ 
     | 
|
| 
       34 
34 
     | 
    
         
             
                  rm -f buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
            USER shipitron
         
     | 
| 
       37 
     | 
    
         
            -
            ENV BUILDX_VERSION v0. 
     | 
| 
      
 37 
     | 
    
         
            +
            ENV BUILDX_VERSION v0.5.1
         
     | 
| 
       38 
38 
     | 
    
         
             
            RUN cd /home/shipitron && \
         
     | 
| 
       39 
39 
     | 
    
         
             
                  wget -nv https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64 && \
         
     | 
| 
       40 
40 
     | 
    
         
             
                  mkdir -p ~/.docker/cli-plugins && \
         
     | 
| 
         @@ -45,14 +45,14 @@ USER root 
     | 
|
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
            WORKDIR /app
         
     | 
| 
       47 
47 
     | 
    
         | 
| 
       48 
     | 
    
         
            -
            ENV SHIPITRON_VERSION=1. 
     | 
| 
      
 48 
     | 
    
         
            +
            ENV SHIPITRON_VERSION=1.4.0
         
     | 
| 
       49 
49 
     | 
    
         | 
| 
       50 
50 
     | 
    
         
             
            RUN gem install shipitron -v ${SHIPITRON_VERSION} && \
         
     | 
| 
       51 
51 
     | 
    
         
             
                mkdir -p /home/shipitron/.ssh && \
         
     | 
| 
       52 
52 
     | 
    
         
             
                chown shipitron:shipitron /home/shipitron/.ssh && \
         
     | 
| 
       53 
53 
     | 
    
         
             
                chmod 700 /home/shipitron/.ssh
         
     | 
| 
       54 
54 
     | 
    
         | 
| 
       55 
     | 
    
         
            -
            COPY scripts/ 
     | 
| 
      
 55 
     | 
    
         
            +
            COPY scripts/release-entrypoint.sh /docker-entrypoint.sh
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
       57 
57 
     | 
    
         
             
            ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
         
     | 
| 
       58 
58 
     | 
    
         
             
            CMD ["help"]
         
     | 
    
        data/Dockerfile.staging
    ADDED
    
    | 
         @@ -0,0 +1,70 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            FROM ruby:2.7.3-alpine
         
     | 
| 
      
 2 
     | 
    
         
            +
            LABEL maintainer="Ryan Schlesinger <ryan@outstand.com>"
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            RUN addgroup -S shipitron && \
         
     | 
| 
      
 5 
     | 
    
         
            +
                adduser -S -G shipitron shipitron && \
         
     | 
| 
      
 6 
     | 
    
         
            +
                addgroup -g 1101 docker && \
         
     | 
| 
      
 7 
     | 
    
         
            +
                addgroup shipitron docker
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            RUN apk add --no-cache \
         
     | 
| 
      
 10 
     | 
    
         
            +
                ca-certificates \
         
     | 
| 
      
 11 
     | 
    
         
            +
                openssl-dev \
         
     | 
| 
      
 12 
     | 
    
         
            +
                tini \
         
     | 
| 
      
 13 
     | 
    
         
            +
                su-exec \
         
     | 
| 
      
 14 
     | 
    
         
            +
                build-base \
         
     | 
| 
      
 15 
     | 
    
         
            +
                git \
         
     | 
| 
      
 16 
     | 
    
         
            +
                git-lfs \
         
     | 
| 
      
 17 
     | 
    
         
            +
                openssh-client \
         
     | 
| 
      
 18 
     | 
    
         
            +
                perl \
         
     | 
| 
      
 19 
     | 
    
         
            +
                bash \
         
     | 
| 
      
 20 
     | 
    
         
            +
                curl \
         
     | 
| 
      
 21 
     | 
    
         
            +
                wget \
         
     | 
| 
      
 22 
     | 
    
         
            +
                jq \
         
     | 
| 
      
 23 
     | 
    
         
            +
                cmake
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            ENV ECR_CREDENTIAL_HELPER_VERSION 0.5.0
         
     | 
| 
      
 26 
     | 
    
         
            +
            RUN cd /usr/local/bin && \
         
     | 
| 
      
 27 
     | 
    
         
            +
                  wget https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${ECR_CREDENTIAL_HELPER_VERSION}/linux-amd64/docker-credential-ecr-login && \
         
     | 
| 
      
 28 
     | 
    
         
            +
                  chmod +x docker-credential-ecr-login
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            ENV BUILDKIT_VERSION v0.8.3
         
     | 
| 
      
 31 
     | 
    
         
            +
            RUN cd /usr/local/bin && \
         
     | 
| 
      
 32 
     | 
    
         
            +
                  wget -nv https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}/buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz && \
         
     | 
| 
      
 33 
     | 
    
         
            +
                  tar --strip-components=1 -zxvf buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz bin/buildctl && \
         
     | 
| 
      
 34 
     | 
    
         
            +
                  chmod +x buildctl && \
         
     | 
| 
      
 35 
     | 
    
         
            +
                  rm -f buildkit-${BUILDKIT_VERSION}.linux-amd64.tar.gz
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            USER shipitron
         
     | 
| 
      
 38 
     | 
    
         
            +
            ENV BUILDX_VERSION v0.5.1
         
     | 
| 
      
 39 
     | 
    
         
            +
            RUN cd /home/shipitron && \
         
     | 
| 
      
 40 
     | 
    
         
            +
                  wget -nv https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64 && \
         
     | 
| 
      
 41 
     | 
    
         
            +
                  mkdir -p ~/.docker/cli-plugins && \
         
     | 
| 
      
 42 
     | 
    
         
            +
                  mv buildx-${BUILDX_VERSION}.linux-amd64 ~/.docker/cli-plugins/docker-buildx && \
         
     | 
| 
      
 43 
     | 
    
         
            +
                  chmod a+x ~/.docker/cli-plugins/docker-buildx
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            USER root
         
     | 
| 
      
 46 
     | 
    
         
            +
            ENV USE_BUNDLE_EXEC true
         
     | 
| 
      
 47 
     | 
    
         
            +
            ENV BUNDLE_GEMFILE /shipitron/Gemfile
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
            ENV BUNDLER_VERSION 2.2.21
         
     | 
| 
      
 50 
     | 
    
         
            +
            RUN gem install bundler -v ${BUNDLER_VERSION} -i /usr/local/lib/ruby/gems/$(ls /usr/local/lib/ruby/gems) --force
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
            WORKDIR /shipitron
         
     | 
| 
      
 53 
     | 
    
         
            +
            COPY Gemfile shipitron.gemspec /shipitron/
         
     | 
| 
      
 54 
     | 
    
         
            +
            COPY lib/shipitron/version.rb /shipitron/lib/shipitron/
         
     | 
| 
      
 55 
     | 
    
         
            +
            COPY exe/shipitron /shipitron/exe/shipitron
         
     | 
| 
      
 56 
     | 
    
         
            +
            COPY .git/ /shipitron/
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
            RUN bundle install
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            COPY . /shipitron/
         
     | 
| 
      
 61 
     | 
    
         
            +
            RUN mkdir -p /home/shipitron/.ssh && \
         
     | 
| 
      
 62 
     | 
    
         
            +
                chown shipitron:shipitron /home/shipitron/.ssh && \
         
     | 
| 
      
 63 
     | 
    
         
            +
                chmod 700 /home/shipitron/.ssh
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
            WORKDIR /app
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
            COPY scripts/release-entrypoint.sh /docker-entrypoint.sh
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
            ENTRYPOINT ["/sbin/tini", "-g", "--", "/docker-entrypoint.sh"]
         
     | 
| 
      
 70 
     | 
    
         
            +
            CMD ["help"]
         
     | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -68,23 +68,25 @@ If a containerized tool requires access to AWS resources, be sure to pass the `A 
     | 
|
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         
             
            ## Development
         
     | 
| 
       70 
70 
     | 
    
         | 
| 
       71 
     | 
    
         
            -
            -  
     | 
| 
       72 
     | 
    
         
            -
            - `dev  
     | 
| 
      
 71 
     | 
    
         
            +
            - `desk go`
         
     | 
| 
      
 72 
     | 
    
         
            +
            - `dev build --pull shipitron`
         
     | 
| 
      
 73 
     | 
    
         
            +
            - `rspec specs` to run specs
         
     | 
| 
       73 
74 
     | 
    
         
             
            - Set the application path in the volumes section in `docker-compose.yml`.
         
     | 
| 
       74 
     | 
    
         
            -
            - ` 
     | 
| 
       75 
     | 
    
         
            -
            - ` 
     | 
| 
       76 
     | 
    
         
            -
            - `dev run --rm -v /bin/docker:/bin/docker -v /var/run/docker.sock:/var/run/docker.sock shipitron server_deploy -- 
     | 
| 
      
 75 
     | 
    
         
            +
            - `shipitron deploy <app>` to run client side
         
     | 
| 
      
 76 
     | 
    
         
            +
            - `shipitron deploy <app> --simulate-store-deploy` to save the deploy options to S3 and generate deploy id
         
     | 
| 
      
 77 
     | 
    
         
            +
            - `dev run --rm -v /bin/docker:/bin/docker -v /var/run/docker.sock:/var/run/docker.sock shipitron server_deploy --deploy-id <deploy_id>` to run server side
         
     | 
| 
       77 
78 
     | 
    
         | 
| 
       78 
79 
     | 
    
         
             
            Running a dev version in production:
         
     | 
| 
       79 
     | 
    
         
            -
            -  
     | 
| 
       80 
     | 
    
         
            -
            - `docker  
     | 
| 
       81 
     | 
    
         
            -
            -  
     | 
| 
       82 
     | 
    
         
            -
            -  
     | 
| 
      
 80 
     | 
    
         
            +
            - Ensure `SHIPITRON_STARTED_BY` env var is set for your `shipitron-staging` task def
         
     | 
| 
      
 81 
     | 
    
         
            +
            - `docker build --pull -t outstand/shipitron:staging -f Dockerfile.staging .`
         
     | 
| 
      
 82 
     | 
    
         
            +
            - `docker push outstand/shipitron:staging`
         
     | 
| 
      
 83 
     | 
    
         
            +
            - Update config to use `shipitron_task: shipitron-staging` and `outstand/shipitron:staging`
         
     | 
| 
      
 84 
     | 
    
         
            +
            - `shipitron deploy <app> --debug`
         
     | 
| 
       83 
85 
     | 
    
         | 
| 
       84 
86 
     | 
    
         
             
            To release a new version:
         
     | 
| 
       85 
87 
     | 
    
         
             
            - Update the version number in `version.rb` and `Dockerfile.release` and commit the result.
         
     | 
| 
       86 
     | 
    
         
            -
            -  
     | 
| 
       87 
     | 
    
         
            -
            - ` 
     | 
| 
      
 88 
     | 
    
         
            +
            - `dev build --pull shipitron`
         
     | 
| 
      
 89 
     | 
    
         
            +
            - `release_gem`
         
     | 
| 
       88 
90 
     | 
    
         
             
            - `VERSION=<version>`
         
     | 
| 
       89 
91 
     | 
    
         
             
            - `docker build -t outstand/shipitron:$VERSION -f Dockerfile.release .`
         
     | 
| 
       90 
92 
     | 
    
         
             
            - `docker push outstand/shipitron:$VERSION`
         
     | 
    
        data/docker-compose.yml
    CHANGED
    
    | 
         @@ -1,24 +1,54 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            version: '3.8'
         
     | 
| 
       2 
2 
     | 
    
         
             
            services:
         
     | 
| 
       3 
3 
     | 
    
         
             
              shipitron:
         
     | 
| 
      
 4 
     | 
    
         
            +
                build: .
         
     | 
| 
       4 
5 
     | 
    
         
             
                image: outstand/shipitron:dev
         
     | 
| 
      
 6 
     | 
    
         
            +
                environment:
         
     | 
| 
      
 7 
     | 
    
         
            +
                  FIXUID:
         
     | 
| 
      
 8 
     | 
    
         
            +
                  FIXGID:
         
     | 
| 
       5 
9 
     | 
    
         
             
                volumes:
         
     | 
| 
       6 
     | 
    
         
            -
                  -  
     | 
| 
      
 10 
     | 
    
         
            +
                  - bundler-data:/usr/local/bundle
         
     | 
| 
      
 11 
     | 
    
         
            +
                  - ~/dev/app:/app # Set this to the application to be shipitron'd
         
     | 
| 
       7 
12 
     | 
    
         
             
                  - shipitron-home:/home/shipitron
         
     | 
| 
       8 
13 
     | 
    
         
             
                  - ~/.config/shipitron:/home/shipitron/.config/shipitron
         
     | 
| 
       9 
14 
     | 
    
         
             
                  - .:/shipitron
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 17 
     | 
    
         
            +
                build: .
         
     | 
| 
       11 
18 
     | 
    
         
             
                image: outstand/shipitron:dev
         
     | 
| 
       12 
     | 
    
         
            -
                command: rspec 
     | 
| 
      
 19 
     | 
    
         
            +
                command: rspec
         
     | 
| 
       13 
20 
     | 
    
         
             
                environment:
         
     | 
| 
       14 
21 
     | 
    
         
             
                  FOG_LOCAL: 'true'
         
     | 
| 
      
 22 
     | 
    
         
            +
                  FIXUID:
         
     | 
| 
      
 23 
     | 
    
         
            +
                  FIXGID:
         
     | 
| 
      
 24 
     | 
    
         
            +
                  BUILDKITE:
         
     | 
| 
      
 25 
     | 
    
         
            +
                  BUILDKITE_BUILD_URL:
         
     | 
| 
      
 26 
     | 
    
         
            +
                  BUILDKITE_JOB_ID:
         
     | 
| 
      
 27 
     | 
    
         
            +
                  BUILDKITE_AGENT_ACCESS_TOKEN:
         
     | 
| 
       15 
28 
     | 
    
         
             
                working_dir: /shipitron
         
     | 
| 
       16 
29 
     | 
    
         
             
                volumes:
         
     | 
| 
      
 30 
     | 
    
         
            +
                  - bundler-data:/usr/local/bundle
         
     | 
| 
       17 
31 
     | 
    
         
             
                  - fog:/fog
         
     | 
| 
       18 
32 
     | 
    
         
             
                  - shipitron-home:/home/shipitron
         
     | 
| 
       19 
     | 
    
         
            -
                  - ~/.config/shipitron:/home/shipitron/.config/shipitron
         
     | 
| 
       20 
33 
     | 
    
         
             
                  - .:/shipitron
         
     | 
| 
       21 
34 
     | 
    
         | 
| 
      
 35 
     | 
    
         
            +
              release_gem:
         
     | 
| 
      
 36 
     | 
    
         
            +
                image: outstand/shipitron:dev
         
     | 
| 
      
 37 
     | 
    
         
            +
                command: rake release
         
     | 
| 
      
 38 
     | 
    
         
            +
                working_dir: /shipitron
         
     | 
| 
      
 39 
     | 
    
         
            +
                environment:
         
     | 
| 
      
 40 
     | 
    
         
            +
                  FIXUID:
         
     | 
| 
      
 41 
     | 
    
         
            +
                  FIXGID:
         
     | 
| 
      
 42 
     | 
    
         
            +
                volumes:
         
     | 
| 
      
 43 
     | 
    
         
            +
                  - bundler-data:/usr/local/bundle
         
     | 
| 
      
 44 
     | 
    
         
            +
                  - shipitron-home:/home/shipitron
         
     | 
| 
      
 45 
     | 
    
         
            +
                  - .:/shipitron
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - ~/.dotfiles/gitconfig:/root/.gitconfig
         
     | 
| 
      
 47 
     | 
    
         
            +
                  - ~/.dotfiles/gitconfig.user:/root/.gitconfig.user
         
     | 
| 
      
 48 
     | 
    
         
            +
                  - ~/.ssh/id_rsa:/root/.ssh/id_rsa
         
     | 
| 
      
 49 
     | 
    
         
            +
                  - ~/.gem:/root/.gem
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
       22 
51 
     | 
    
         
             
            volumes:
         
     | 
| 
       23 
52 
     | 
    
         
             
              fog:
         
     | 
| 
       24 
53 
     | 
    
         
             
              shipitron-home:
         
     | 
| 
      
 54 
     | 
    
         
            +
              bundler-data:
         
     | 
    
        data/lib/shipitron.rb
    CHANGED
    
    | 
         @@ -7,6 +7,8 @@ require 'shipitron/smash' 
     | 
|
| 
       7 
7 
     | 
    
         
             
            module Shipitron
         
     | 
| 
       8 
8 
     | 
    
         
             
              CONFIG_FILE = 'shipitron/config.yml'.freeze
         
     | 
| 
       9 
9 
     | 
    
         
             
              SECRETS_FILE = '~/.config/shipitron/secrets.yml'.freeze
         
     | 
| 
      
 10 
     | 
    
         
            +
              GLOBAL_CONFIG_FILE = '~/.config/shipitron/config.yml'.freeze
         
     | 
| 
      
 11 
     | 
    
         
            +
              DEPLOY_BUCKET_PREFIX = "deploys/"
         
     | 
| 
       10 
12 
     | 
    
         | 
| 
       11 
13 
     | 
    
         
             
              class << self
         
     | 
| 
       12 
14 
     | 
    
         
             
                def config_file
         
     | 
| 
         @@ -18,10 +20,10 @@ module Shipitron 
     | 
|
| 
       18 
20 
     | 
    
         
             
                end
         
     | 
| 
       19 
21 
     | 
    
         | 
| 
       20 
22 
     | 
    
         
             
                def config
         
     | 
| 
       21 
     | 
    
         
            -
                  @config ||= Smash.load(Pathname.new(config_file).expand_path.to_s).merge(secrets)
         
     | 
| 
      
 23 
     | 
    
         
            +
                  @config ||= Smash.load(Pathname.new(config_file).expand_path.to_s).merge(secrets).merge(global_config)
         
     | 
| 
       22 
24 
     | 
    
         
             
                rescue ArgumentError
         
     | 
| 
       23 
25 
     | 
    
         
             
                  Logger.warn "Config file '#{config_file}' does not exist"
         
     | 
| 
       24 
     | 
    
         
            -
                  @config = secrets
         
     | 
| 
      
 26 
     | 
    
         
            +
                  @config = secrets.merge(global_config)
         
     | 
| 
       25 
27 
     | 
    
         
             
                end
         
     | 
| 
       26 
28 
     | 
    
         | 
| 
       27 
29 
     | 
    
         
             
                def secrets_file
         
     | 
| 
         @@ -38,5 +40,20 @@ module Shipitron 
     | 
|
| 
       38 
40 
     | 
    
         
             
                  Logger.warn "Secrets file '#{secrets_file}' does not exist"
         
     | 
| 
       39 
41 
     | 
    
         
             
                  @secrets = Smash.new
         
     | 
| 
       40 
42 
     | 
    
         
             
                end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                def global_config_file
         
     | 
| 
      
 45 
     | 
    
         
            +
                  @global_config_file ||= GLOBAL_CONFIG_FILE
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                def global_config_file=(file)
         
     | 
| 
      
 49 
     | 
    
         
            +
                  @global_config_file = file
         
     | 
| 
      
 50 
     | 
    
         
            +
                end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                def global_config
         
     | 
| 
      
 53 
     | 
    
         
            +
                  @global_config ||= Smash.load(Pathname.new(global_config_file).expand_path.to_s)
         
     | 
| 
      
 54 
     | 
    
         
            +
                rescue ArgumentError
         
     | 
| 
      
 55 
     | 
    
         
            +
                  Logger.warn "Global config file '#{global_config_file}' does not exist"
         
     | 
| 
      
 56 
     | 
    
         
            +
                  @global_config = Smash.new
         
     | 
| 
      
 57 
     | 
    
         
            +
                end
         
     | 
| 
       41 
58 
     | 
    
         
             
              end
         
     | 
| 
       42 
59 
     | 
    
         
             
            end
         
     | 
    
        data/lib/shipitron/cli.rb
    CHANGED
    
    | 
         @@ -12,18 +12,22 @@ module Shipitron 
     | 
|
| 
       12 
12 
     | 
    
         
             
                desc 'deploy <app>', 'Deploys the app'
         
     | 
| 
       13 
13 
     | 
    
         
             
                option :config_file, default: 'shipitron/config.yml'
         
     | 
| 
       14 
14 
     | 
    
         
             
                option :secrets_file, default: '~/.config/shipitron/secrets.yml'
         
     | 
| 
      
 15 
     | 
    
         
            +
                option :global_config_file, default: '~/.config/shipitron/config.yml'
         
     | 
| 
       15 
16 
     | 
    
         
             
                option :debug, type: :boolean, default: false
         
     | 
| 
       16 
17 
     | 
    
         
             
                option :simulate, type: :boolean, default: false
         
     | 
| 
      
 18 
     | 
    
         
            +
                option :simulate_store_deploy, type: :boolean, default: false, desc: "Simulate and store deploy config in S3"
         
     | 
| 
       17 
19 
     | 
    
         
             
                def deploy(app)
         
     | 
| 
       18 
20 
     | 
    
         
             
                  setup(
         
     | 
| 
       19 
21 
     | 
    
         
             
                    config_file: options[:config_file],
         
     | 
| 
       20 
     | 
    
         
            -
                    secrets_file: options[:secrets_file]
         
     | 
| 
      
 22 
     | 
    
         
            +
                    secrets_file: options[:secrets_file],
         
     | 
| 
      
 23 
     | 
    
         
            +
                    global_config_file: options[:global_config_file]
         
     | 
| 
       21 
24 
     | 
    
         
             
                  )
         
     | 
| 
       22 
25 
     | 
    
         | 
| 
       23 
26 
     | 
    
         
             
                  require 'shipitron/client/deploy_application'
         
     | 
| 
       24 
27 
     | 
    
         
             
                  result = Client::DeployApplication.call(
         
     | 
| 
       25 
28 
     | 
    
         
             
                    application: app,
         
     | 
| 
       26 
     | 
    
         
            -
                    simulate: options[:simulate]
         
     | 
| 
      
 29 
     | 
    
         
            +
                    simulate: options[:simulate],
         
     | 
| 
      
 30 
     | 
    
         
            +
                    simulate_store_deploy: options[:simulate_store_deploy]
         
     | 
| 
       27 
31 
     | 
    
         
             
                  )
         
     | 
| 
       28 
32 
     | 
    
         | 
| 
       29 
33 
     | 
    
         
             
                  if result.failure?
         
     | 
| 
         @@ -59,49 +63,40 @@ module Shipitron 
     | 
|
| 
       59 
63 
     | 
    
         | 
| 
       60 
64 
     | 
    
         | 
| 
       61 
65 
     | 
    
         
             
                desc 'server_deploy', 'Server-side component of deploy'
         
     | 
| 
       62 
     | 
    
         
            -
                option : 
     | 
| 
       63 
     | 
    
         
            -
                option :repository, required: true
         
     | 
| 
       64 
     | 
    
         
            -
                option :repository_branch, default: 'master'
         
     | 
| 
       65 
     | 
    
         
            -
                option :registry, default: nil
         
     | 
| 
       66 
     | 
    
         
            -
                option :bucket, required: true
         
     | 
| 
       67 
     | 
    
         
            -
                option :build_cache_location, default: 'tmp/build-cache.tar.gz'
         
     | 
| 
       68 
     | 
    
         
            -
                option :image_name, required: true
         
     | 
| 
       69 
     | 
    
         
            -
                option :named_tag, default: 'latest'
         
     | 
| 
       70 
     | 
    
         
            -
                option :skip_push, type: :boolean, default: false
         
     | 
| 
       71 
     | 
    
         
            -
                option :region, required: true
         
     | 
| 
       72 
     | 
    
         
            -
                option :clusters, type: :array, required: true
         
     | 
| 
       73 
     | 
    
         
            -
                option :ecs_task_defs, type: :array, required: true
         
     | 
| 
       74 
     | 
    
         
            -
                option :ecs_task_def_templates, type: :array, default: []
         
     | 
| 
       75 
     | 
    
         
            -
                option :ecs_services, type: :array, default: []
         
     | 
| 
       76 
     | 
    
         
            -
                option :ecs_service_templates, type: :array, default: []
         
     | 
| 
       77 
     | 
    
         
            -
                option :build_script, default: nil
         
     | 
| 
       78 
     | 
    
         
            -
                option :post_builds, type: :array
         
     | 
| 
       79 
     | 
    
         
            -
                option :secrets_file, default: '~/.config/shipitron/secrets.yml'
         
     | 
| 
       80 
     | 
    
         
            -
                option :debug, type: :boolean, default: false
         
     | 
| 
      
 66 
     | 
    
         
            +
                option :deploy_id, required: true
         
     | 
| 
       81 
67 
     | 
    
         
             
                def server_deploy
         
     | 
| 
       82 
     | 
    
         
            -
                  setup 
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
                  )
         
     | 
| 
      
 68 
     | 
    
         
            +
                  setup
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
                  if !ENV.key?("SHIPITRON_DEPLOY_BUCKET") || !ENV.key?("SHIPITRON_DEPLOY_BUCKET_REGION")
         
     | 
| 
      
 71 
     | 
    
         
            +
                    raise "Missing shipitron deploy bucket env vars!"
         
     | 
| 
      
 72 
     | 
    
         
            +
                  end
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
                  require 'shipitron/server/fetch_deploy'
         
     | 
| 
      
 75 
     | 
    
         
            +
                  deploy_options = Server::FetchDeploy.call!(
         
     | 
| 
      
 76 
     | 
    
         
            +
                    deploy_bucket: ENV["SHIPITRON_DEPLOY_BUCKET"],
         
     | 
| 
      
 77 
     | 
    
         
            +
                    deploy_bucket_region: ENV["SHIPITRON_DEPLOY_BUCKET_REGION"],
         
     | 
| 
      
 78 
     | 
    
         
            +
                    deploy_id: options[:deploy_id]
         
     | 
| 
      
 79 
     | 
    
         
            +
                  ).deploy_options
         
     | 
| 
       85 
80 
     | 
    
         | 
| 
       86 
81 
     | 
    
         
             
                  require 'shipitron/server/transform_cli_args'
         
     | 
| 
       87 
82 
     | 
    
         
             
                  cli_args = Server::TransformCliArgs.call!(
         
     | 
| 
       88 
     | 
    
         
            -
                    application:  
     | 
| 
       89 
     | 
    
         
            -
                    repository_url:  
     | 
| 
       90 
     | 
    
         
            -
                    repository_branch:  
     | 
| 
       91 
     | 
    
         
            -
                    registry:  
     | 
| 
       92 
     | 
    
         
            -
                    s3_cache_bucket:  
     | 
| 
       93 
     | 
    
         
            -
                    build_cache_location:  
     | 
| 
       94 
     | 
    
         
            -
                    image_name:  
     | 
| 
       95 
     | 
    
         
            -
                    named_tag:  
     | 
| 
       96 
     | 
    
         
            -
                    skip_push:  
     | 
| 
       97 
     | 
    
         
            -
                    region:  
     | 
| 
       98 
     | 
    
         
            -
                    clusters:  
     | 
| 
       99 
     | 
    
         
            -
                    ecs_task_defs:  
     | 
| 
       100 
     | 
    
         
            -
                    ecs_task_def_templates:  
     | 
| 
       101 
     | 
    
         
            -
                    ecs_services:  
     | 
| 
       102 
     | 
    
         
            -
                    ecs_service_templates:  
     | 
| 
       103 
     | 
    
         
            -
                    build_script:  
     | 
| 
       104 
     | 
    
         
            -
                    post_builds:  
     | 
| 
      
 83 
     | 
    
         
            +
                    application: deploy_options[:name],
         
     | 
| 
      
 84 
     | 
    
         
            +
                    repository_url: deploy_options[:repository],
         
     | 
| 
      
 85 
     | 
    
         
            +
                    repository_branch: deploy_options[:repository_branch],
         
     | 
| 
      
 86 
     | 
    
         
            +
                    registry: deploy_options[:registry],
         
     | 
| 
      
 87 
     | 
    
         
            +
                    s3_cache_bucket: deploy_options[:bucket],
         
     | 
| 
      
 88 
     | 
    
         
            +
                    build_cache_location: deploy_options[:build_cache_location],
         
     | 
| 
      
 89 
     | 
    
         
            +
                    image_name: deploy_options[:image_name],
         
     | 
| 
      
 90 
     | 
    
         
            +
                    named_tag: deploy_options[:named_tag],
         
     | 
| 
      
 91 
     | 
    
         
            +
                    skip_push: deploy_options[:skip_push],
         
     | 
| 
      
 92 
     | 
    
         
            +
                    region: deploy_options[:region],
         
     | 
| 
      
 93 
     | 
    
         
            +
                    clusters: deploy_options[:clusters],
         
     | 
| 
      
 94 
     | 
    
         
            +
                    ecs_task_defs: deploy_options[:ecs_task_defs],
         
     | 
| 
      
 95 
     | 
    
         
            +
                    ecs_task_def_templates: deploy_options[:ecs_task_def_templates],
         
     | 
| 
      
 96 
     | 
    
         
            +
                    ecs_services: deploy_options[:ecs_services],
         
     | 
| 
      
 97 
     | 
    
         
            +
                    ecs_service_templates: deploy_options[:ecs_service_templates],
         
     | 
| 
      
 98 
     | 
    
         
            +
                    build_script: deploy_options[:build_script],
         
     | 
| 
      
 99 
     | 
    
         
            +
                    post_builds: deploy_options[:post_builds]
         
     | 
| 
       105 
100 
     | 
    
         
             
                  ).cli_args
         
     | 
| 
       106 
101 
     | 
    
         | 
| 
       107 
102 
     | 
    
         
             
                  require 'shipitron/server/deploy_application'
         
     | 
| 
         @@ -149,7 +144,7 @@ module Shipitron 
     | 
|
| 
       149 
144 
     | 
    
         
             
                end
         
     | 
| 
       150 
145 
     | 
    
         | 
| 
       151 
146 
     | 
    
         
             
                private
         
     | 
| 
       152 
     | 
    
         
            -
                def setup(config_file:nil, secrets_file:nil)
         
     | 
| 
      
 147 
     | 
    
         
            +
                def setup(config_file:nil, secrets_file:nil, global_config_file:nil)
         
     | 
| 
       153 
148 
     | 
    
         
             
                  $stdout.sync = true
         
     | 
| 
       154 
149 
     | 
    
         
             
                  if options[:debug] == false
         
     | 
| 
       155 
150 
     | 
    
         
             
                    Logger.level = :info
         
     | 
| 
         @@ -157,6 +152,7 @@ module Shipitron 
     | 
|
| 
       157 
152 
     | 
    
         | 
| 
       158 
153 
     | 
    
         
             
                  Shipitron.config_file = config_file unless config_file.nil?
         
     | 
| 
       159 
154 
     | 
    
         
             
                  Shipitron.secrets_file = secrets_file unless secrets_file.nil?
         
     | 
| 
      
 155 
     | 
    
         
            +
                  Shipitron.global_config_file = global_config_file unless global_config_file.nil?
         
     | 
| 
       160 
156 
     | 
    
         
             
                end
         
     | 
| 
       161 
157 
     | 
    
         
             
              end
         
     | 
| 
       162 
158 
     | 
    
         
             
            end
         
     | 
    
        data/lib/shipitron/client.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,41 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'shipitron'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'shipitron/client'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'shipitron/fetch_bucket'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'aws-sdk-s3'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'pastel'
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            module Shipitron
         
     | 
| 
      
 8 
     | 
    
         
            +
              module Client
         
     | 
| 
      
 9 
     | 
    
         
            +
                class GenerateDeploy
         
     | 
| 
      
 10 
     | 
    
         
            +
                  include Metaractor
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                  required :server_deploy_opts
         
     | 
| 
      
 13 
     | 
    
         
            +
                  required :deploy_id
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                  def call
         
     | 
| 
      
 16 
     | 
    
         
            +
                    s3_key = "#{Shipitron::DEPLOY_BUCKET_PREFIX}#{context.deploy_id}"
         
     | 
| 
      
 17 
     | 
    
         
            +
                    pastel = Pastel.new
         
     | 
| 
      
 18 
     | 
    
         
            +
                    Logger.info "Uploading deploy config to #{pastel.blue("s3://#{deploy_bucket}/#{s3_key}")}"
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                    client = Aws::S3::Client.new(region: deploy_bucket_region)
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                    client.put_object(
         
     | 
| 
      
 23 
     | 
    
         
            +
                      bucket: deploy_bucket,
         
     | 
| 
      
 24 
     | 
    
         
            +
                      key: s3_key,
         
     | 
| 
      
 25 
     | 
    
         
            +
                      body: context.server_deploy_opts.to_json,
         
     | 
| 
      
 26 
     | 
    
         
            +
                      acl: "private"
         
     | 
| 
      
 27 
     | 
    
         
            +
                    )
         
     | 
| 
      
 28 
     | 
    
         
            +
                  end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  private
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                  def deploy_bucket
         
     | 
| 
      
 33 
     | 
    
         
            +
                    Shipitron.config.deploy_bucket
         
     | 
| 
      
 34 
     | 
    
         
            +
                  end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                  def deploy_bucket_region
         
     | 
| 
      
 37 
     | 
    
         
            +
                    Shipitron.config.deploy_bucket_region
         
     | 
| 
      
 38 
     | 
    
         
            +
                  end
         
     | 
| 
      
 39 
     | 
    
         
            +
                end
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
| 
      
 41 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -1,6 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'shipitron'
         
     | 
| 
       2 
2 
     | 
    
         
             
            require 'shipitron/client'
         
     | 
| 
       3 
3 
     | 
    
         
             
            require 'shipitron/post_build'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'aws-sdk-core'
         
     | 
| 
       4 
5 
     | 
    
         | 
| 
       5 
6 
     | 
    
         
             
            module Shipitron
         
     | 
| 
       6 
7 
     | 
    
         
             
              module Client
         
     | 
| 
         @@ -38,6 +39,19 @@ module Shipitron 
     | 
|
| 
       38 
39 
     | 
    
         
             
                    context.ecs_services = config.ecs_services
         
     | 
| 
       39 
40 
     | 
    
         
             
                    context.ecs_task_def_dir = config.ecs_task_def_dir
         
     | 
| 
       40 
41 
     | 
    
         
             
                    context.ecs_service_dir = config.ecs_service_dir
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                    if Shipitron.config.aws_access_key_id? && Shipitron.config.aws_secret_access_key?
         
     | 
| 
      
 44 
     | 
    
         
            +
                      Aws.config.update(
         
     | 
| 
      
 45 
     | 
    
         
            +
                        credentials: Aws::Credentials.new(
         
     | 
| 
      
 46 
     | 
    
         
            +
                          Shipitron.config.aws_access_key_id,
         
     | 
| 
      
 47 
     | 
    
         
            +
                          Shipitron.config.aws_secret_access_key
         
     | 
| 
      
 48 
     | 
    
         
            +
                        )
         
     | 
| 
      
 49 
     | 
    
         
            +
                      )
         
     | 
| 
      
 50 
     | 
    
         
            +
                    end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                    if !Shipitron.config.deploy_bucket? || !Shipitron.config.deploy_bucket_region?
         
     | 
| 
      
 53 
     | 
    
         
            +
                      raise "Missing required deploy bucket configuration!"
         
     | 
| 
      
 54 
     | 
    
         
            +
                    end
         
     | 
| 
       41 
55 
     | 
    
         
             
                  end
         
     | 
| 
       42 
56 
     | 
    
         | 
| 
       43 
57 
     | 
    
         
             
                  private
         
     | 
| 
         @@ -1,10 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'shipitron'
         
     | 
| 
       2 
2 
     | 
    
         
             
            require 'shipitron/client'
         
     | 
| 
       3 
3 
     | 
    
         
             
            require 'shipitron/ecs_client'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'shipitron/client/generate_deploy'
         
     | 
| 
       4 
5 
     | 
    
         
             
            require 'shellwords'
         
     | 
| 
       5 
6 
     | 
    
         
             
            require 'base64'
         
     | 
| 
       6 
7 
     | 
    
         
             
            require 'tty-table'
         
     | 
| 
       7 
8 
     | 
    
         
             
            require 'pastel'
         
     | 
| 
      
 9 
     | 
    
         
            +
            require 'securerandom'
         
     | 
| 
       8 
10 
     | 
    
         | 
| 
       9 
11 
     | 
    
         
             
            module Shipitron
         
     | 
| 
       10 
12 
     | 
    
         
             
              module Client
         
     | 
| 
         @@ -21,23 +23,17 @@ module Shipitron 
     | 
|
| 
       21 
23 
     | 
    
         
             
                  required :image_name
         
     | 
| 
       22 
24 
     | 
    
         
             
                  required :named_tag
         
     | 
| 
       23 
25 
     | 
    
         
             
                  required :ecs_task_defs
         
     | 
| 
       24 
     | 
    
         
            -
                  optional :ecs_task_def_templates
         
     | 
| 
       25 
     | 
    
         
            -
                  optional :ecs_services
         
     | 
| 
       26 
     | 
    
         
            -
                  optional :ecs_service_templates
         
     | 
| 
      
 26 
     | 
    
         
            +
                  optional :ecs_task_def_templates, default: []
         
     | 
| 
      
 27 
     | 
    
         
            +
                  optional :ecs_services, default: []
         
     | 
| 
      
 28 
     | 
    
         
            +
                  optional :ecs_service_templates, default: []
         
     | 
| 
       27 
29 
     | 
    
         
             
                  optional :build_script
         
     | 
| 
       28 
30 
     | 
    
         
             
                  optional :skip_push
         
     | 
| 
       29 
     | 
    
         
            -
                  optional :post_builds
         
     | 
| 
      
 31 
     | 
    
         
            +
                  optional :post_builds, default: []
         
     | 
| 
       30 
32 
     | 
    
         
             
                  optional :simulate
         
     | 
| 
      
 33 
     | 
    
         
            +
                  optional :simulate_store_deploy
         
     | 
| 
       31 
34 
     | 
    
         
             
                  optional :repository_branch
         
     | 
| 
       32 
35 
     | 
    
         
             
                  optional :registry
         
     | 
| 
       33 
36 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
                  before do
         
     | 
| 
       35 
     | 
    
         
            -
                    context.post_builds ||= []
         
     | 
| 
       36 
     | 
    
         
            -
                    context.ecs_task_def_templates ||= {}
         
     | 
| 
       37 
     | 
    
         
            -
                    context.ecs_services ||= []
         
     | 
| 
       38 
     | 
    
         
            -
                    context.ecs_service_templates ||= {}
         
     | 
| 
       39 
     | 
    
         
            -
                  end
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
37 
     | 
    
         
             
                  def call
         
     | 
| 
       42 
38 
     | 
    
         
             
                    Logger.info "Skipping ECS run_task calls due to --simulate" if simulate?
         
     | 
| 
       43 
39 
     | 
    
         | 
| 
         @@ -56,27 +52,31 @@ module Shipitron 
     | 
|
| 
       56 
52 
     | 
    
         
             
                      Logger.info line.chomp
         
     | 
| 
       57 
53 
     | 
    
         
             
                    end
         
     | 
| 
       58 
54 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
                    cluster = clusters.first
         
     | 
| 
      
 55 
     | 
    
         
            +
                    @cluster = clusters.first
         
     | 
| 
       60 
56 
     | 
    
         | 
| 
       61 
57 
     | 
    
         
             
                    begin
         
     | 
| 
       62 
58 
     | 
    
         
             
                      if simulate?
         
     | 
| 
       63 
     | 
    
         
            -
                         
     | 
| 
      
 59 
     | 
    
         
            +
                        server_deploy_opts
         
     | 
| 
      
 60 
     | 
    
         
            +
                        generate_deploy! if context.simulate_store_deploy == true
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
       64 
62 
     | 
    
         
             
                        return
         
     | 
| 
       65 
63 
     | 
    
         
             
                      end
         
     | 
| 
       66 
64 
     | 
    
         | 
| 
       67 
     | 
    
         
            -
                       
     | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
      
 65 
     | 
    
         
            +
                      generate_deploy!
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
                      response = ecs_client(region: @cluster.region).run_task(
         
     | 
| 
      
 68 
     | 
    
         
            +
                        cluster: @cluster.name,
         
     | 
| 
       69 
69 
     | 
    
         
             
                        task_definition: shipitron_task,
         
     | 
| 
       70 
70 
     | 
    
         
             
                        overrides: {
         
     | 
| 
       71 
71 
     | 
    
         
             
                          container_overrides: [
         
     | 
| 
       72 
72 
     | 
    
         
             
                            {
         
     | 
| 
       73 
73 
     | 
    
         
             
                              name: 'shipitron',
         
     | 
| 
       74 
     | 
    
         
            -
                              command: command_args( 
     | 
| 
      
 74 
     | 
    
         
            +
                              command: command_args(deploy_id: deploy_id)
         
     | 
| 
       75 
75 
     | 
    
         
             
                            }
         
     | 
| 
       76 
76 
     | 
    
         
             
                          ]
         
     | 
| 
       77 
77 
     | 
    
         
             
                        },
         
     | 
| 
       78 
78 
     | 
    
         
             
                        count: 1,
         
     | 
| 
       79 
     | 
    
         
            -
                        started_by: Shipitron::Client 
     | 
| 
      
 79 
     | 
    
         
            +
                        started_by: Shipitron::Client.started_by
         
     | 
| 
       80 
80 
     | 
    
         
             
                      )
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
82 
     | 
    
         
             
                      if !response.failures.empty?
         
     | 
| 
         @@ -106,81 +106,99 @@ module Shipitron 
     | 
|
| 
       106 
106 
     | 
    
         
             
                    context.shipitron_task
         
     | 
| 
       107 
107 
     | 
    
         
             
                  end
         
     | 
| 
       108 
108 
     | 
    
         | 
| 
       109 
     | 
    
         
            -
                  def  
     | 
| 
      
 109 
     | 
    
         
            +
                  def deploy_id
         
     | 
| 
      
 110 
     | 
    
         
            +
                    return @_deploy_id if defined?(@_deploy_id)
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                    @_deploy_id = SecureRandom.uuid
         
     | 
| 
      
 113 
     | 
    
         
            +
                  end
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                  def generate_deploy!
         
     | 
| 
      
 116 
     | 
    
         
            +
                    Shipitron::Client::GenerateDeploy.call!(
         
     | 
| 
      
 117 
     | 
    
         
            +
                      server_deploy_opts: server_deploy_opts,
         
     | 
| 
      
 118 
     | 
    
         
            +
                      deploy_id: deploy_id
         
     | 
| 
      
 119 
     | 
    
         
            +
                    )
         
     | 
| 
      
 120 
     | 
    
         
            +
                  end
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
                  def command_args(deploy_id:)
         
     | 
| 
       110 
123 
     | 
    
         
             
                    [
         
     | 
| 
       111 
124 
     | 
    
         
             
                      'server_deploy',
         
     | 
| 
       112 
     | 
    
         
            -
                      '-- 
     | 
| 
       113 
     | 
    
         
            -
             
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
       115 
     | 
    
         
            -
                      '--build-cache-location', context.build_cache_location,
         
     | 
| 
       116 
     | 
    
         
            -
                      '--image-name', context.image_name,
         
     | 
| 
       117 
     | 
    
         
            -
                      '--named-tag', context.named_tag,
         
     | 
| 
       118 
     | 
    
         
            -
                      '--region', cluster.region,
         
     | 
| 
       119 
     | 
    
         
            -
                    ].tap do |ary|
         
     | 
| 
       120 
     | 
    
         
            -
                      ary << '--clusters'
         
     | 
| 
       121 
     | 
    
         
            -
                      ary.concat(context.clusters.map(&:name))
         
     | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
       123 
     | 
    
         
            -
                      ary << '--ecs-task-defs'
         
     | 
| 
       124 
     | 
    
         
            -
                      ary.concat(context.ecs_task_defs)
         
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
                      unless context.ecs_services.empty?
         
     | 
| 
       127 
     | 
    
         
            -
                        ary << '--ecs-services'
         
     | 
| 
       128 
     | 
    
         
            -
                        ary.concat(context.ecs_services)
         
     | 
| 
       129 
     | 
    
         
            -
                      end
         
     | 
| 
      
 125 
     | 
    
         
            +
                      '--deploy-id', deploy_id
         
     | 
| 
      
 126 
     | 
    
         
            +
                    ]
         
     | 
| 
      
 127 
     | 
    
         
            +
                  end
         
     | 
| 
       130 
128 
     | 
    
         | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
       132 
     | 
    
         
            -
             
     | 
| 
       133 
     | 
    
         
            -
             
     | 
| 
      
 129 
     | 
    
         
            +
                  def server_deploy_opts
         
     | 
| 
      
 130 
     | 
    
         
            +
                    return @_server_deploy_opts if defined?(@_server_deploy_opts)
         
     | 
| 
      
 131 
     | 
    
         
            +
             
     | 
| 
      
 132 
     | 
    
         
            +
                    @_server_deploy_opts =
         
     | 
| 
      
 133 
     | 
    
         
            +
                      {
         
     | 
| 
      
 134 
     | 
    
         
            +
                        name: context.application,
         
     | 
| 
      
 135 
     | 
    
         
            +
                        repository: context.repository_url,
         
     | 
| 
      
 136 
     | 
    
         
            +
                        bucket: context.s3_cache_bucket,
         
     | 
| 
      
 137 
     | 
    
         
            +
                        build_cache_location: context.build_cache_location,
         
     | 
| 
      
 138 
     | 
    
         
            +
                        image_name: context.image_name,
         
     | 
| 
      
 139 
     | 
    
         
            +
                        named_tag: context.named_tag,
         
     | 
| 
      
 140 
     | 
    
         
            +
                        region: @cluster.region
         
     | 
| 
      
 141 
     | 
    
         
            +
                      }.tap do |opts|
         
     | 
| 
      
 142 
     | 
    
         
            +
                        opts[:clusters] =
         
     | 
| 
      
 143 
     | 
    
         
            +
                          context.clusters.map(&:name)
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
                        opts[:ecs_task_defs] =
         
     | 
| 
      
 146 
     | 
    
         
            +
                          context.ecs_task_defs
         
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
      
 148 
     | 
    
         
            +
                        unless context.ecs_services.empty?
         
     | 
| 
      
 149 
     | 
    
         
            +
                          opts[:ecs_services] =
         
     | 
| 
      
 150 
     | 
    
         
            +
                            context.ecs_services
         
     | 
| 
      
 151 
     | 
    
         
            +
                        end
         
     | 
| 
       134 
152 
     | 
    
         | 
| 
       135 
     | 
    
         
            -
             
     | 
| 
       136 
     | 
    
         
            -
             
     | 
| 
       137 
     | 
    
         
            -
             
     | 
| 
      
 153 
     | 
    
         
            +
                        if context.registry != nil
         
     | 
| 
      
 154 
     | 
    
         
            +
                          opts[:registry] = context.registry
         
     | 
| 
      
 155 
     | 
    
         
            +
                        end
         
     | 
| 
       138 
156 
     | 
    
         | 
| 
       139 
     | 
    
         
            -
             
     | 
| 
       140 
     | 
    
         
            -
             
     | 
| 
       141 
     | 
    
         
            -
             
     | 
| 
      
 157 
     | 
    
         
            +
                        if context.build_script != nil
         
     | 
| 
      
 158 
     | 
    
         
            +
                          opts[:build_script] = context.build_script
         
     | 
| 
      
 159 
     | 
    
         
            +
                        end
         
     | 
| 
       142 
160 
     | 
    
         | 
| 
       143 
     | 
    
         
            -
             
     | 
| 
       144 
     | 
    
         
            -
             
     | 
| 
       145 
     | 
    
         
            -
                         
     | 
| 
       146 
     | 
    
         
            -
                      end
         
     | 
| 
      
 161 
     | 
    
         
            +
                        if context.skip_push != nil
         
     | 
| 
      
 162 
     | 
    
         
            +
                          opts[:skip_push] = context.skip_push.to_s
         
     | 
| 
      
 163 
     | 
    
         
            +
                        end
         
     | 
| 
       147 
164 
     | 
    
         | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
             
     | 
| 
       151 
     | 
    
         
            -
             
     | 
| 
       152 
     | 
    
         
            -
                            if context.ecs_task_defs.include?(name)
         
     | 
| 
       153 
     | 
    
         
            -
                              Base64.urlsafe_encode64(data)
         
     | 
| 
       154 
     | 
    
         
            -
                            end
         
     | 
| 
       155 
     | 
    
         
            -
                          end.compact
         
     | 
| 
       156 
     | 
    
         
            -
                        )
         
     | 
| 
       157 
     | 
    
         
            -
                      end
         
     | 
| 
      
 165 
     | 
    
         
            +
                        if !context.post_builds.empty?
         
     | 
| 
      
 166 
     | 
    
         
            +
                          opts[:post_builds] =
         
     | 
| 
      
 167 
     | 
    
         
            +
                            context.post_builds.map(&:to_s)
         
     | 
| 
      
 168 
     | 
    
         
            +
                        end
         
     | 
| 
       158 
169 
     | 
    
         | 
| 
       159 
     | 
    
         
            -
             
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
                               
     | 
| 
       165 
     | 
    
         
            -
                            end
         
     | 
| 
       166 
     | 
    
         
            -
             
     | 
| 
       167 
     | 
    
         
            -
                        )
         
     | 
| 
       168 
     | 
    
         
            -
                      end
         
     | 
| 
      
 170 
     | 
    
         
            +
                        if !context.ecs_task_def_templates.empty?
         
     | 
| 
      
 171 
     | 
    
         
            +
                          opts[:ecs_task_def_templates] =
         
     | 
| 
      
 172 
     | 
    
         
            +
                            context.ecs_task_def_templates.map do |name, data|
         
     | 
| 
      
 173 
     | 
    
         
            +
                              if context.ecs_task_defs.include?(name)
         
     | 
| 
      
 174 
     | 
    
         
            +
                                Base64.urlsafe_encode64(data)
         
     | 
| 
      
 175 
     | 
    
         
            +
                              end
         
     | 
| 
      
 176 
     | 
    
         
            +
                            end.compact
         
     | 
| 
      
 177 
     | 
    
         
            +
                        end
         
     | 
| 
       169 
178 
     | 
    
         | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
             
     | 
| 
       172 
     | 
    
         
            -
             
     | 
| 
      
 179 
     | 
    
         
            +
                        if !context.ecs_service_templates.empty?
         
     | 
| 
      
 180 
     | 
    
         
            +
                          opts[:ecs_service_templates] =
         
     | 
| 
      
 181 
     | 
    
         
            +
                            context.ecs_service_templates.map do |name, data|
         
     | 
| 
      
 182 
     | 
    
         
            +
                              if context.ecs_services.include?(name)
         
     | 
| 
      
 183 
     | 
    
         
            +
                                Base64.urlsafe_encode64(data)
         
     | 
| 
      
 184 
     | 
    
         
            +
                              end
         
     | 
| 
      
 185 
     | 
    
         
            +
                            end.compact
         
     | 
| 
      
 186 
     | 
    
         
            +
                        end
         
     | 
| 
       173 
187 
     | 
    
         | 
| 
       174 
     | 
    
         
            -
             
     | 
| 
       175 
     | 
    
         
            -
             
     | 
| 
       176 
     | 
    
         
            -
             
     | 
| 
       177 
     | 
    
         
            -
             
     | 
| 
      
 188 
     | 
    
         
            +
                        unless context.repository_branch.nil?
         
     | 
| 
      
 189 
     | 
    
         
            +
                          opts[:repository_branch] = context.repository_branch
         
     | 
| 
      
 190 
     | 
    
         
            +
                        end
         
     | 
| 
      
 191 
     | 
    
         
            +
             
     | 
| 
      
 192 
     | 
    
         
            +
                        if simulate?
         
     | 
| 
      
 193 
     | 
    
         
            +
                          Logger.info "server_deploy opts:\n#{JSON.pretty_generate(opts)}"
         
     | 
| 
      
 194 
     | 
    
         
            +
                        else
         
     | 
| 
      
 195 
     | 
    
         
            +
                          Logger.debug "server_deploy opts:\n#{JSON.pretty_generate(opts)}"
         
     | 
| 
      
 196 
     | 
    
         
            +
                        end
         
     | 
| 
       178 
197 
     | 
    
         
             
                      end
         
     | 
| 
       179 
     | 
    
         
            -
                    end
         
     | 
| 
       180 
198 
     | 
    
         
             
                  end
         
     | 
| 
       181 
199 
     | 
    
         | 
| 
       182 
200 
     | 
    
         
             
                  def simulate?
         
     | 
| 
       183 
     | 
    
         
            -
                    context.simulate == true
         
     | 
| 
      
 201 
     | 
    
         
            +
                    context.simulate == true || context.simulate_store_deploy == true
         
     | 
| 
       184 
202 
     | 
    
         
             
                  end
         
     | 
| 
       185 
203 
     | 
    
         
             
                end
         
     | 
| 
       186 
204 
     | 
    
         
             
              end
         
     | 
| 
         @@ -0,0 +1,50 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'shipitron'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'aws-sdk-s3'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'json'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            module Shipitron
         
     | 
| 
      
 6 
     | 
    
         
            +
              module Server
         
     | 
| 
      
 7 
     | 
    
         
            +
                class FetchDeploy
         
     | 
| 
      
 8 
     | 
    
         
            +
                  include Metaractor
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                  required :deploy_bucket
         
     | 
| 
      
 11 
     | 
    
         
            +
                  required :deploy_bucket_region
         
     | 
| 
      
 12 
     | 
    
         
            +
                  required :deploy_id
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                  def call
         
     | 
| 
      
 15 
     | 
    
         
            +
                    s3_key = "#{Shipitron::DEPLOY_BUCKET_PREFIX}#{context.deploy_id}"
         
     | 
| 
      
 16 
     | 
    
         
            +
                    Logger.info "Fetching deploy config from s3://#{deploy_bucket}/#{s3_key}"
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                    response = client.get_object(
         
     | 
| 
      
 19 
     | 
    
         
            +
                      bucket: deploy_bucket,
         
     | 
| 
      
 20 
     | 
    
         
            +
                      key: s3_key
         
     | 
| 
      
 21 
     | 
    
         
            +
                    )
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                    context.deploy_options =
         
     | 
| 
      
 24 
     | 
    
         
            +
                      JSON.parse(response.body.read)
         
     | 
| 
      
 25 
     | 
    
         
            +
                      .transform_keys {|k| k.to_sym }
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                  private
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                  def client
         
     | 
| 
      
 31 
     | 
    
         
            +
                    Aws::S3::Client.new(
         
     | 
| 
      
 32 
     | 
    
         
            +
                      region: deploy_bucket_region,
         
     | 
| 
      
 33 
     | 
    
         
            +
                      **client_opts
         
     | 
| 
      
 34 
     | 
    
         
            +
                    )
         
     | 
| 
      
 35 
     | 
    
         
            +
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                  def client_opts
         
     | 
| 
      
 38 
     | 
    
         
            +
                    {}
         
     | 
| 
      
 39 
     | 
    
         
            +
                  end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                  def deploy_bucket
         
     | 
| 
      
 42 
     | 
    
         
            +
                    context.deploy_bucket
         
     | 
| 
      
 43 
     | 
    
         
            +
                  end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                  def deploy_bucket_region
         
     | 
| 
      
 46 
     | 
    
         
            +
                    context.deploy_bucket_region
         
     | 
| 
      
 47 
     | 
    
         
            +
                  end
         
     | 
| 
      
 48 
     | 
    
         
            +
                end
         
     | 
| 
      
 49 
     | 
    
         
            +
              end
         
     | 
| 
      
 50 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/shipitron/version.rb
    CHANGED
    
    
| 
         @@ -1,14 +1,26 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/bin/sh
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            set -euo pipefail
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            su-exec ${FIXUID:?Missing FIXUID var}:${FIXGID:?Missing FIXGID var} fixuid
         
     | 
| 
       3 
6 
     | 
    
         | 
| 
       4 
7 
     | 
    
         
             
            chown_dir() {
         
     | 
| 
       5 
8 
     | 
    
         
             
              dir=$1
         
     | 
| 
       6 
     | 
    
         
            -
              if [ "$(stat -c %u ${dir})"  
     | 
| 
       7 
     | 
    
         
            -
                chown  
     | 
| 
      
 9 
     | 
    
         
            +
              if [[ -d ${dir} ]] && [[ "$(stat -c %u:%g ${dir})" != "${FIXUID}:${FIXGID}" ]]; then
         
     | 
| 
      
 10 
     | 
    
         
            +
                echo chown $dir
         
     | 
| 
      
 11 
     | 
    
         
            +
                chown shipitron:shipitron $dir
         
     | 
| 
       8 
12 
     | 
    
         
             
              fi
         
     | 
| 
       9 
13 
     | 
    
         
             
            }
         
     | 
| 
       10 
14 
     | 
    
         | 
| 
       11 
15 
     | 
    
         
             
            chown_dir /home/shipitron
         
     | 
| 
      
 16 
     | 
    
         
            +
            chown_dir /usr/local/bundle
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            if [ "$1" = 'bundle' ]; then
         
     | 
| 
      
 19 
     | 
    
         
            +
              set -- su-exec shipitron "$@"
         
     | 
| 
      
 20 
     | 
    
         
            +
              exec "$@"
         
     | 
| 
      
 21 
     | 
    
         
            +
            elif [ "$1" = 'rake' ] && [ "$2" = 'release' ]; then
         
     | 
| 
      
 22 
     | 
    
         
            +
              exec "$@"
         
     | 
| 
      
 23 
     | 
    
         
            +
            fi
         
     | 
| 
       12 
24 
     | 
    
         | 
| 
       13 
25 
     | 
    
         
             
            if [ -n "$USE_BUNDLE_EXEC" ]; then
         
     | 
| 
       14 
26 
     | 
    
         
             
              BINARY="bundle exec shipitron"
         
     | 
| 
         @@ -16,10 +28,23 @@ else 
     | 
|
| 
       16 
28 
     | 
    
         
             
              BINARY=shipitron
         
     | 
| 
       17 
29 
     | 
    
         
             
            fi
         
     | 
| 
       18 
30 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
            if  
     | 
| 
      
 31 
     | 
    
         
            +
            if [ "$(ls -A /usr/local/bundle/bin)" = '' ]; then
         
     | 
| 
      
 32 
     | 
    
         
            +
              echo 'command not in path and bundler not initialized'
         
     | 
| 
      
 33 
     | 
    
         
            +
              echo 'running bundle install'
         
     | 
| 
      
 34 
     | 
    
         
            +
              su-exec shipitron bundle install
         
     | 
| 
      
 35 
     | 
    
         
            +
            else
         
     | 
| 
      
 36 
     | 
    
         
            +
              su-exec shipitron bash -c 'bundle check || bundle install'
         
     | 
| 
      
 37 
     | 
    
         
            +
            fi
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            # ${BINARY} help "$1"
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            if ls /usr/local/bundle/bin | grep -q "\b$1\b"; then
         
     | 
| 
      
 42 
     | 
    
         
            +
              set -- su-exec shipitron bundle exec "$@"
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            elif ${BINARY} help "$1" 2>&1 | grep -q "shipitron $1"; then
         
     | 
| 
       20 
45 
     | 
    
         
             
              set -- su-exec shipitron ${BINARY} "$@"
         
     | 
| 
       21 
46 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
              if [ -n "$FOG_LOCAL" ]; then
         
     | 
| 
      
 47 
     | 
    
         
            +
              if [ -n "${FOG_LOCAL:-}" ]; then
         
     | 
| 
       23 
48 
     | 
    
         
             
                chown -R shipitron:shipitron /fog
         
     | 
| 
       24 
49 
     | 
    
         
             
              fi
         
     | 
| 
       25 
50 
     | 
    
         
             
            fi
         
     | 
| 
         @@ -0,0 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/bin/sh
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            set -euo pipefail
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            if [ -n "$USE_BUNDLE_EXEC" ]; then
         
     | 
| 
      
 6 
     | 
    
         
            +
              BINARY="bundle exec shipitron"
         
     | 
| 
      
 7 
     | 
    
         
            +
            else
         
     | 
| 
      
 8 
     | 
    
         
            +
              BINARY=shipitron
         
     | 
| 
      
 9 
     | 
    
         
            +
            fi
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            # ${BINARY} help "$1"
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            if ls /usr/local/bundle/bin | grep -q "\b$1\b"; then
         
     | 
| 
      
 14 
     | 
    
         
            +
              set -- su-exec shipitron bundle exec "$@"
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            elif ${BINARY} help "$1" 2>&1 | grep -q "shipitron $1"; then
         
     | 
| 
      
 17 
     | 
    
         
            +
              set -- su-exec shipitron ${BINARY} "$@"
         
     | 
| 
      
 18 
     | 
    
         
            +
            fi
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            exec "$@"
         
     | 
    
        data/shipitron.gemspec
    CHANGED
    
    | 
         @@ -19,8 +19,9 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
              spec.add_runtime_dependency 'thor', '~> 1.0'
         
     | 
| 
       21 
21 
     | 
    
         
             
              spec.add_runtime_dependency 'aws-sdk-ecs', '~> 1.8'
         
     | 
| 
      
 22 
     | 
    
         
            +
              spec.add_runtime_dependency 'aws-sdk-s3', '~> 1.96'
         
     | 
| 
       22 
23 
     | 
    
         
             
              spec.add_runtime_dependency 'hashie', '~> 4.1'
         
     | 
| 
       23 
     | 
    
         
            -
              spec.add_runtime_dependency 'metaractor', '~> 3. 
     | 
| 
      
 24 
     | 
    
         
            +
              spec.add_runtime_dependency 'metaractor', '~> 3.1'
         
     | 
| 
       24 
25 
     | 
    
         
             
              spec.add_runtime_dependency 'diplomat', '~> 2.0'
         
     | 
| 
       25 
26 
     | 
    
         
             
              spec.add_runtime_dependency 'fog-aws', '~> 3.6'
         
     | 
| 
       26 
27 
     | 
    
         
             
              spec.add_runtime_dependency 'mime-types', '~> 3.1'
         
     | 
| 
         @@ -29,13 +30,13 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       29 
30 
     | 
    
         
             
              spec.add_runtime_dependency 'tty-command', '~> 0.7'
         
     | 
| 
       30 
31 
     | 
    
         
             
              spec.add_runtime_dependency 'tty-table', '~> 0.9'
         
     | 
| 
       31 
32 
     | 
    
         
             
              spec.add_runtime_dependency 'pastel', '~> 0.7'
         
     | 
| 
       32 
     | 
    
         
            -
              spec.add_runtime_dependency 'excon', '~> 0. 
     | 
| 
      
 33 
     | 
    
         
            +
              spec.add_runtime_dependency 'excon', '~> 0.82'
         
     | 
| 
       33 
34 
     | 
    
         
             
              spec.add_runtime_dependency 'rugged', '~> 1.0'
         
     | 
| 
       34 
35 
     | 
    
         | 
| 
       35 
36 
     | 
    
         
             
              spec.add_development_dependency "bundler", "~> 2.1"
         
     | 
| 
       36 
37 
     | 
    
         
             
              spec.add_development_dependency "rake", "~> 13.0"
         
     | 
| 
       37 
     | 
    
         
            -
              spec.add_development_dependency "pry-byebug", "~> 3. 
     | 
| 
       38 
     | 
    
         
            -
              spec.add_development_dependency "rspec", "~> 3. 
     | 
| 
      
 38 
     | 
    
         
            +
              spec.add_development_dependency "pry-byebug", "~> 3.9"
         
     | 
| 
      
 39 
     | 
    
         
            +
              spec.add_development_dependency "rspec", "~> 3.10"
         
     | 
| 
       39 
40 
     | 
    
         
             
              spec.add_development_dependency "fivemat", "~> 1.3"
         
     | 
| 
       40 
41 
     | 
    
         
             
              spec.add_development_dependency "fog-local", "~> 0.4"
         
     | 
| 
       41 
42 
     | 
    
         
             
            end
         
     | 
    
        data/test.yml
    ADDED
    
    
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.4.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: 2021- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-06-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: thor
         
     | 
| 
         @@ -38,6 +38,20 @@ dependencies: 
     | 
|
| 
       38 
38 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       39 
39 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
40 
     | 
    
         
             
                    version: '1.8'
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: aws-sdk-s3
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 44 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '1.96'
         
     | 
| 
      
 48 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 49 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 50 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '1.96'
         
     | 
| 
       41 
55 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       42 
56 
     | 
    
         
             
              name: hashie
         
     | 
| 
       43 
57 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -58,14 +72,14 @@ dependencies: 
     | 
|
| 
       58 
72 
     | 
    
         
             
                requirements:
         
     | 
| 
       59 
73 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       60 
74 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       61 
     | 
    
         
            -
                    version: '3. 
     | 
| 
      
 75 
     | 
    
         
            +
                    version: '3.1'
         
     | 
| 
       62 
76 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       63 
77 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       64 
78 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       65 
79 
     | 
    
         
             
                requirements:
         
     | 
| 
       66 
80 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       67 
81 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       68 
     | 
    
         
            -
                    version: '3. 
     | 
| 
      
 82 
     | 
    
         
            +
                    version: '3.1'
         
     | 
| 
       69 
83 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       70 
84 
     | 
    
         
             
              name: diplomat
         
     | 
| 
       71 
85 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -184,14 +198,14 @@ dependencies: 
     | 
|
| 
       184 
198 
     | 
    
         
             
                requirements:
         
     | 
| 
       185 
199 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       186 
200 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       187 
     | 
    
         
            -
                    version: '0. 
     | 
| 
      
 201 
     | 
    
         
            +
                    version: '0.82'
         
     | 
| 
       188 
202 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       189 
203 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       190 
204 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       191 
205 
     | 
    
         
             
                requirements:
         
     | 
| 
       192 
206 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       193 
207 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       194 
     | 
    
         
            -
                    version: '0. 
     | 
| 
      
 208 
     | 
    
         
            +
                    version: '0.82'
         
     | 
| 
       195 
209 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       196 
210 
     | 
    
         
             
              name: rugged
         
     | 
| 
       197 
211 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -240,28 +254,28 @@ dependencies: 
     | 
|
| 
       240 
254 
     | 
    
         
             
                requirements:
         
     | 
| 
       241 
255 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       242 
256 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       243 
     | 
    
         
            -
                    version: '3. 
     | 
| 
      
 257 
     | 
    
         
            +
                    version: '3.9'
         
     | 
| 
       244 
258 
     | 
    
         
             
              type: :development
         
     | 
| 
       245 
259 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       246 
260 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       247 
261 
     | 
    
         
             
                requirements:
         
     | 
| 
       248 
262 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       249 
263 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       250 
     | 
    
         
            -
                    version: '3. 
     | 
| 
      
 264 
     | 
    
         
            +
                    version: '3.9'
         
     | 
| 
       251 
265 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       252 
266 
     | 
    
         
             
              name: rspec
         
     | 
| 
       253 
267 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       254 
268 
     | 
    
         
             
                requirements:
         
     | 
| 
       255 
269 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       256 
270 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       257 
     | 
    
         
            -
                    version: '3. 
     | 
| 
      
 271 
     | 
    
         
            +
                    version: '3.10'
         
     | 
| 
       258 
272 
     | 
    
         
             
              type: :development
         
     | 
| 
       259 
273 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       260 
274 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       261 
275 
     | 
    
         
             
                requirements:
         
     | 
| 
       262 
276 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       263 
277 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       264 
     | 
    
         
            -
                    version: '3. 
     | 
| 
      
 278 
     | 
    
         
            +
                    version: '3.10'
         
     | 
| 
       265 
279 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       266 
280 
     | 
    
         
             
              name: fivemat
         
     | 
| 
       267 
281 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -298,17 +312,19 @@ executables: 
     | 
|
| 
       298 
312 
     | 
    
         
             
            extensions: []
         
     | 
| 
       299 
313 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       300 
314 
     | 
    
         
             
            files:
         
     | 
| 
      
 315 
     | 
    
         
            +
            - ".buildkite/pipeline.yml"
         
     | 
| 
       301 
316 
     | 
    
         
             
            - ".dockerignore"
         
     | 
| 
       302 
317 
     | 
    
         
             
            - ".gitattributes"
         
     | 
| 
       303 
318 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       304 
319 
     | 
    
         
             
            - ".rspec"
         
     | 
| 
      
 320 
     | 
    
         
            +
            - Deskfile
         
     | 
| 
       305 
321 
     | 
    
         
             
            - Dockerfile
         
     | 
| 
       306 
322 
     | 
    
         
             
            - Dockerfile.release
         
     | 
| 
      
 323 
     | 
    
         
            +
            - Dockerfile.staging
         
     | 
| 
       307 
324 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       308 
325 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       309 
326 
     | 
    
         
             
            - README.md
         
     | 
| 
       310 
327 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       311 
     | 
    
         
            -
            - build_dev.sh
         
     | 
| 
       312 
328 
     | 
    
         
             
            - docker-compose.yml
         
     | 
| 
       313 
329 
     | 
    
         
             
            - exe/shipitron
         
     | 
| 
       314 
330 
     | 
    
         
             
            - lib/shipitron.rb
         
     | 
| 
         @@ -320,6 +336,7 @@ files: 
     | 
|
| 
       320 
336 
     | 
    
         
             
            - lib/shipitron/client/ensure_deploy_not_running.rb
         
     | 
| 
       321 
337 
     | 
    
         
             
            - lib/shipitron/client/fetch_clusters.rb
         
     | 
| 
       322 
338 
     | 
    
         
             
            - lib/shipitron/client/force_deploy.rb
         
     | 
| 
      
 339 
     | 
    
         
            +
            - lib/shipitron/client/generate_deploy.rb
         
     | 
| 
       323 
340 
     | 
    
         
             
            - lib/shipitron/client/load_application_config.rb
         
     | 
| 
       324 
341 
     | 
    
         
             
            - lib/shipitron/client/load_templates.rb
         
     | 
| 
       325 
342 
     | 
    
         
             
            - lib/shipitron/client/register_ecs_task_definitions.rb
         
     | 
| 
         @@ -346,6 +363,7 @@ files: 
     | 
|
| 
       346 
363 
     | 
    
         
             
            - lib/shipitron/server/ecs_task_defs/map_parsed_templates.rb
         
     | 
| 
       347 
364 
     | 
    
         
             
            - lib/shipitron/server/ecs_task_defs/update_from_params.rb
         
     | 
| 
       348 
365 
     | 
    
         
             
            - lib/shipitron/server/ecs_task_defs/update_in_place.rb
         
     | 
| 
      
 366 
     | 
    
         
            +
            - lib/shipitron/server/fetch_deploy.rb
         
     | 
| 
       349 
367 
     | 
    
         
             
            - lib/shipitron/server/git/clone_local_copy.rb
         
     | 
| 
       350 
368 
     | 
    
         
             
            - lib/shipitron/server/git/configure.rb
         
     | 
| 
       351 
369 
     | 
    
         
             
            - lib/shipitron/server/git/download_cache.rb
         
     | 
| 
         @@ -361,7 +379,9 @@ files: 
     | 
|
| 
       361 
379 
     | 
    
         
             
            - lib/shipitron/smash.rb
         
     | 
| 
       362 
380 
     | 
    
         
             
            - lib/shipitron/version.rb
         
     | 
| 
       363 
381 
     | 
    
         
             
            - scripts/docker-entrypoint.sh
         
     | 
| 
      
 382 
     | 
    
         
            +
            - scripts/release-entrypoint.sh
         
     | 
| 
       364 
383 
     | 
    
         
             
            - shipitron.gemspec
         
     | 
| 
      
 384 
     | 
    
         
            +
            - test.yml
         
     | 
| 
       365 
385 
     | 
    
         
             
            homepage: https://github.com/outstand/shipitron
         
     | 
| 
       366 
386 
     | 
    
         
             
            licenses: []
         
     | 
| 
       367 
387 
     | 
    
         
             
            metadata: {}
         
     | 
| 
         @@ -380,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       380 
400 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       381 
401 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       382 
402 
     | 
    
         
             
            requirements: []
         
     | 
| 
       383 
     | 
    
         
            -
            rubygems_version: 3.1. 
     | 
| 
      
 403 
     | 
    
         
            +
            rubygems_version: 3.1.6
         
     | 
| 
       384 
404 
     | 
    
         
             
            signing_key:
         
     | 
| 
       385 
405 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       386 
406 
     | 
    
         
             
            summary: A deployment tool for use with Docker and ECS.
         
     | 
    
        data/build_dev.sh
    DELETED
    
    | 
         @@ -1,27 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #!/bin/bash
         
     | 
| 
       2 
     | 
    
         
            -
            set -e -x
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            build_image=outstand/shipitron:dev
         
     | 
| 
       5 
     | 
    
         
            -
            dockerfile=Dockerfile
         
     | 
| 
       6 
     | 
    
         
            -
            bundler_data_dir=cache
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            tar_container=''
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
            function cleanup {
         
     | 
| 
       11 
     | 
    
         
            -
              if [ -n "$tar_container" ]; then
         
     | 
| 
       12 
     | 
    
         
            -
                docker rm -fv ${tar_container}
         
     | 
| 
       13 
     | 
    
         
            -
              fi
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
              rm -f ${bundler_data_dir}/cidfile
         
     | 
| 
       16 
     | 
    
         
            -
            }
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
            trap cleanup EXIT
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            build_args=''
         
     | 
| 
       21 
     | 
    
         
            -
            mkdir -p ${bundler_data_dir}
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
            docker build --pull -t ${build_image} -f ${dockerfile} ${build_args} .
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
            docker run -t --cidfile=${bundler_data_dir}/cidfile -w /usr/local/bundle ${build_image} tar -zcf /tmp/bundler-data.tar.gz .
         
     | 
| 
       26 
     | 
    
         
            -
            tar_container=$(cat ${bundler_data_dir}/cidfile)
         
     | 
| 
       27 
     | 
    
         
            -
            docker cp ${tar_container}:/tmp/bundler-data.tar.gz ${bundler_data_dir}/bundler-data.tar.gz
         
     |