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

Upgrade circleci base image used for docker build #3157

Closed
wants to merge 4 commits into from
Closed
Changes from 3 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
39 changes: 3 additions & 36 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -630,40 +630,6 @@ jobs:
npm run dev-setup

docker-build-and-push:
docker:
- image: circleci/buildpack-deps:stretch
parameters:
repo:
type: string
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Get tag or latest
command: |
# order of precendence for IMAGE tag is:
# 1. CIRCLE_TAG if defined,
# 2. Branch name if 'hotfix' in branch name (branch name passed in via $CIRCLE_BRANCH)
# 3. 'latest', which is the default
echo "export IMAGE_TAG=`[ $CIRCLE_TAG ] && echo $(echo $CIRCLE_TAG | cut -d@ -f3) || [[ "$CIRCLE_BRANCH" =~ (hotfix) ]] && echo $CIRCLE_BRANCH || echo "latest" `" | tee -a $BASH_ENV
- run:
name: Docker login
command: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- run:
name: Docker build << parameters.repo >>
command: |
cd << parameters.repo >>
docker build -t audius/<< parameters.repo >>:$IMAGE_TAG -t audius/<< parameters.repo>>:$(git rev-parse HEAD) --build-arg git_sha=$(git rev-parse HEAD) --build-arg audius_loggly_disable=$audius_loggly_disable --build-arg audius_loggly_token=$audius_loggly_token --build-arg audius_loggly_tags=$audius_loggly_tags --build-arg BUILD_NUM=$CIRCLE_BUILD_NUM .
docker image prune --filter label=prune=true --filter label=build=$CIRCLE_BUILD_NUM --force
- run:
name: Docker push << parameters.repo >>
command: |
docker push audius/<< parameters.repo >>:$IMAGE_TAG
docker push audius/<< parameters.repo >>:$(git rev-parse HEAD)

docker-build-and-push-updated:
docker:
- image: cimg/base:2022.03
parameters:
Expand All @@ -690,7 +656,8 @@ jobs:
name: Docker build << parameters.repo >>
command: |
cd << parameters.repo >>
docker build -t audius/<< parameters.repo >>:$IMAGE_TAG -t audius/<< parameters.repo>>:$(git rev-parse HEAD) --build-arg git_sha=$(git rev-parse HEAD) --build-arg audius_loggly_disable=$audius_loggly_disable --build-arg audius_loggly_token=$audius_loggly_token --build-arg audius_loggly_tags=$audius_loggly_tags .
docker build -t audius/<< parameters.repo >>:$IMAGE_TAG -t audius/<< parameters.repo>>:$(git rev-parse HEAD) --build-arg git_sha=$(git rev-parse HEAD) --build-arg audius_loggly_disable=$audius_loggly_disable --build-arg audius_loggly_token=$audius_loggly_token --build-arg audius_loggly_tags=$audius_loggly_tags --build-arg BUILD_NUM=$CIRCLE_BUILD_NUM .
docker image prune --filter label=prune=true --filter label=build=$CIRCLE_BUILD_NUM --force
Copy link
Contributor Author

@dmanjunath dmanjunath May 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- run:
name: Docker push << parameters.repo >>
command: |
Expand Down Expand Up @@ -721,7 +688,7 @@ workflows:

- test-discovery-provider:
name: test-discovery-provider
- docker-build-and-push-updated:
- docker-build-and-push:
name: build-discovery-provider
repo: discovery-provider

Expand Down