Skip to content

Commit

Permalink
Generate an image tag with the branch name and a build UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
sjahl committed Sep 6, 2024
1 parent 6f3f419 commit fff5b75
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions .cloudbuild/reads.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ steps:
[
'build',
'-t',
'us-docker.pkg.dev/$PROJECT_ID/gnomad/gnomad-reads-server:$SHORT_SHA',
'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-server:$SHORT_SHA',
'-t',
'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-server:${_BUILD_TAG}',
'-f',
'deploy/dockerfiles/reads/reads-server.dockerfile',
'.',
Expand All @@ -14,12 +16,21 @@ steps:
[
'build',
'-t',
'us-docker.pkg.dev/$PROJECT_ID/gnomad/gnomad-reads-api:$SHORT_SHA',
'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-api:$SHORT_SHA',
'-t',
'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-api:${_BUILD_TAG}',
'-f',
'deploy/dockerfiles/reads/auth.dockerfile',
'deploy/dockerfiles/reads/reads-api.dockerfile',
'.',
]
# TODO: commented out for testing without push
# images:
# - 'us-docker.pkg.dev/$PROJECT_ID/gnomad/gnomad-reads-server:$SHORT_SHA'
# - 'us-docker.pkg.dev/$PROJECT_ID/gnomad/gnomad-reads-api:$SHORT_SHA'
options:
dynamicSubstitutions: true
substitutions:
_BUILD_TAG: '${_BRANCH_FOR_IMAGE_NAME}-${BUILD_ID}'

# push tag with the short sha, and also a branch-based UUID
images:
- 'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-server:$SHORT_SHA'
- 'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-server:${_BUILD_TAG}'
- 'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-api:$SHORT_SHA'
- 'us-docker.pkg.dev/${PROJECT_ID}/gnomad/gnomad-reads-api:${_BUILD_TAG}'

0 comments on commit fff5b75

Please sign in to comment.