diff --git a/.changeset/lucky-pants-peel.md b/.changeset/lucky-pants-peel.md new file mode 100644 index 000000000..1c208498d --- /dev/null +++ b/.changeset/lucky-pants-peel.md @@ -0,0 +1,7 @@ +--- +'skuba': patch +--- + +**template/lambda-sqs-worker-cdk:** Always build before deploy + +This prevents stale compiled code from being cached and deployed from ECR. diff --git a/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml b/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml index c8f01c279..c3ba98099 100644 --- a/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +++ b/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml @@ -35,19 +35,21 @@ steps: - echo "--- Running yarn test :jest:" - yarn test - - label: 'CDK Deploy Staging :shipit:' + - label: 'Build & CDK Deploy Staging :shipit:' <<: *dev-agent plugins: <<: *plugins depends_on: - test command: + - echo "--- Building code" + - yarn build - echo "--- Running CDK deploy to staging" - yarn deploy:dev concurrency: 1 concurrency_group: '<%- repoName %>/deploy/dev' - - label: 'CDK Deploy Production :shipit:' + - label: 'Build & CDK Deploy Production :shipit:' branches: 'master' <<: *prod-agent plugins: @@ -55,6 +57,8 @@ steps: depends_on: - test command: + - echo "--- Building code" + - yarn build - echo "--- Running CDK deploy to production" - yarn deploy:prod concurrency: 1 diff --git a/template/lambda-sqs-worker-cdk/Dockerfile b/template/lambda-sqs-worker-cdk/Dockerfile index 1ef531c54..95d85a688 100644 --- a/template/lambda-sqs-worker-cdk/Dockerfile +++ b/template/lambda-sqs-worker-cdk/Dockerfile @@ -20,11 +20,3 @@ FROM node:14-alpine AS dev-deps WORKDIR /workdir COPY --from=unsafe-dev-deps /workdir . - -### - -FROM dev-deps AS build - -COPY . . - -RUN yarn build