Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleCI: publish Docker image to AWS ECR #4

Merged
merged 2 commits into from
Nov 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ version: 2.1
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
node: circleci/node@4.7
aws-ecr: circleci/aws-ecr@7.3.0

#############################################################
# Parameters
#############################################################
parameters:
repo:
type: string
default: "nodejs-playground"

jobs:
node-test:
Expand All @@ -28,15 +37,26 @@ jobs:
done
echo Failed waiting for RabbitMQ && exit 1

- run: npm install
- run: npm ci
- run: npm run test

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
build-and-deploy:
jobs:
- node-test:
context:
- playground
- aws-ecr/build-and-push-image:
requires:
- node-test # Only run deploy job once tests passed
repo: << pipeline.parameters.repo >>
filters:
branches:
only:
- master
name: Upgrade & Publish into ECR
context: playground-aws
#Job params
tag: "${CIRCLE_SHA1}"