Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #18 from LF-Engineering/clean-up-cicd
Browse files Browse the repository at this point in the history
Clean up cicd pipeline
  • Loading branch information
khalifapro authored Aug 30, 2022
2 parents 66e617e + 1ba607a commit 68cec49
Showing 1 changed file with 6 additions and 33 deletions.
39 changes: 6 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ jobs:
command: |
eval "echo 'export AWS_ACCESS_KEY_ID=\$$AWS_ACCESS_KEY_ID_ENV_VAR'" >> $BASH_ENV
eval "echo 'export AWS_SECRET_ACCESS_KEY=\$$AWS_SECRET_ACCESS_KEY_ENV_VAR'" >> $BASH_ENV
eval "echo 'export AWS_ACCOUNT_ID=\$$AWS_ACCOUNT_ID_ENV_VAR'" >> $BASH_ENV
eval "echo 'export AWS_DEFAULT_REGION=\$$AWS_REGION_ENV_VAR'" >> $BASH_ENV
- run:
name: Setup common environment variables
command: |
echo 'export FULL_IMAGE_NAME="${AWS_ACCOUNT_ID_ENV_VAR}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/insights-connector-confluence:${TAG}"' >> $BASH_ENV
echo 'export FULL_IMAGE_NAME="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/insights-connector-confluence:${TAG}"' >> $BASH_ENV
- run:
name: Authenticate ECR
command: |
aws ecr get-login-password | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID_ENV_VAR}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com
aws ecr get-login-password | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com
- run:
name: setup the docker repository to be able to push image in aws (should succeed on first time & allowed to fail later)
command: |
Expand All @@ -62,28 +61,15 @@ jobs:
AWS_REGION_ENV_VAR: AWS_REGION_DEV
AWS_ACCESS_KEY_ID_ENV_VAR: AWS_ACCESS_KEY_ID_DEV
AWS_SECRET_ACCESS_KEY_ENV_VAR: AWS_SECRET_ACCESS_KEY_DEV
AWS_ACCOUNT_ID_ENV_VAR: "395594542180"
GITHUB_TOKEN: GITHUB_TOKEN
STAGE: dev
TAG: latest

deploy_test:
<<: *deploy
environment:
AWS_ACCESS_KEY_ID_ENV_VAR: AWS_ACCESS_KEY_ID_TEST
AWS_SECRET_ACCESS_KEY_ENV_VAR: AWS_SECRET_ACCESS_KEY_TEST
AWS_ACCOUNT_ID_ENV_VAR: AWS_ACCOUNT_ID_TEST
AWS_REGION_ENV_VAR: AWS_REGION_TEST
GITHUB_TOKEN: GITHUB_TOKEN
STAGE: test
TAG: test

deploy_prod:
<<: *deploy
environment:
AWS_ACCESS_KEY_ID_ENV_VAR: AWS_ACCESS_KEY_ID_PROD
AWS_SECRET_ACCESS_KEY_ENV_VAR: AWS_SECRET_ACCESS_KEY_PROD
AWS_ACCOUNT_ID_ENV_VAR: AWS_ACCOUNT_ID_PROD
AWS_REGION_ENV_VAR: AWS_REGION_PROD
GITHUB_TOKEN: GITHUB_TOKEN
STAGE: prod
Expand All @@ -94,30 +80,15 @@ workflows:
jobs:
- build
- deploy_dev:
context:
- development
requires:
- build
filters:
branches:
only: main
tags:
ignore: /.*/
- approve_test:
type: approval
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /^v\d+(\.\d+)?(\.\d+)?$/
- deploy_test:
requires:
- approve_test
filters:
branches:
ignore: /.*/
tags:
only: /^v\d+(\.\d+)?(\.\d+)?$/
- approve_prod:
type: approval
requires:
Expand All @@ -128,6 +99,8 @@ workflows:
tags:
only: /^v\d+(\.\d+)?(\.\d+)?$/
- deploy_prod:
context:
- production
requires:
- approve_prod
filters:
Expand Down

0 comments on commit 68cec49

Please sign in to comment.