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

Tag the newly built docker as remote latest and push to the remote registry #1742

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 4 additions & 0 deletions push_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ remote_image_name=$REGISTRY_SERVER:$REGISTRY_PORT/$docker_image_name:$DOCKER_IMA
timestamp="$(date -u +%Y%m%d)"
build_version="${timestamp}.bld-${BUILD_NUMBER}"
build_remote_image_name=$REGISTRY_SERVER:$REGISTRY_PORT/$docker_image_name:$build_version
remote_image_name_latest=$REGISTRY_SERVER:$REGISTRY_PORT/$docker_image_name:latest

## Add registry information as tag, so will push as latest
## Add additional tag with build information
docker tag $docker_image_name $remote_image_name
docker tag $docker_image_name $build_remote_image_name
docker tag $docker_image_name $remote_image_name_latest

## Login the docker image registry server
## Note: user name and password are passed from command line
Expand All @@ -39,4 +41,6 @@ echo "Image sha256: $image_sha"
echo "Pushing $build_remote_image_name"
docker push $build_remote_image_name
docker rmi $build_remote_image_name || true
docker push $remote_image_name_latest
docker rmi $remote_image_name_latest || true
docker rmi $docker_image_name || true