Skip to content

Commit

Permalink
feat: tweak docker labels
Browse files Browse the repository at this point in the history
- release is better than git because git is also used for commit hashes
- branch will tell us if a container is built from main or not

Co-Authored-By: Rowan Manning <[email protected]>
  • Loading branch information
2 people authored and ivomurrell committed Jan 9, 2025
1 parent ff4fa5d commit 90ec26a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/docker/src/image-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function getImageTagsFromEnvironment({

const gitTag = process.env.CIRCLE_TAG
if (gitTag) {
tags.push(`git-${gitTag}`)
tags.push(`release-${gitTag}`)
}

const buildNumber = process.env.CIRCLE_BUILD_NUM
Expand All @@ -37,6 +37,11 @@ export function getImageTagsFromEnvironment({
tags.push(`local-${process.env.USER || 'unknown'}`)
}

const branchName = process.env.CIRCLE_BRANCH
if (branchName) {
tags.push(`branch-${branchName}`)
}

const imageName = buildImageName({ registry, name })
return tags.map((tag) => `${imageName}:${sanitizeDockerTag(tag)}`)
}

0 comments on commit 90ec26a

Please sign in to comment.