From 8842f9213560d9bb228b749d2a3b8cfe28f7929a Mon Sep 17 00:00:00 2001 From: damienungseek Date: Mon, 24 May 2021 12:55:56 +1000 Subject: [PATCH] Build lambda-sqs-worker-cdk before deploy (#428) Co-authored-by: Ryan Ling --- .changeset/lucky-pants-peel.md | 7 +++++++ template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml | 8 ++++++-- template/lambda-sqs-worker-cdk/Dockerfile | 8 -------- 3 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 .changeset/lucky-pants-peel.md 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