mirror of https://github.com/halo-dev/halo
parent
50405a9409
commit
db00883c3d
|
@ -198,11 +198,12 @@ tasks.named('generateOpenApiDocs') {
|
||||||
}
|
}
|
||||||
|
|
||||||
def name = 'halo'
|
def name = 'halo'
|
||||||
|
def branchName = grgit.branch.current().name.replaceAll("/", "-")
|
||||||
def tagName = "${project.version}-cnb"
|
def tagName = "${project.version}-cnb"
|
||||||
def isRelease = Objects.equals(project.findProperty('release'), 'true')
|
def isRelease = Objects.equals(project.findProperty('release'), 'true')
|
||||||
if (!isRelease) {
|
if (!isRelease) {
|
||||||
name = 'halo-dev'
|
name = 'halo-dev'
|
||||||
tagName = "cnb-sha-${grgit.head().abbreviatedId}"
|
tagName = "sha-${grgit.head().abbreviatedId}-cnb"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register('publishToGhcr', BootBuildImage) {
|
tasks.register('publishToGhcr', BootBuildImage) {
|
||||||
|
@ -211,7 +212,7 @@ tasks.register('publishToGhcr', BootBuildImage) {
|
||||||
imageName = "ghcr.io/halo-dev/${name}:${tagName}"
|
imageName = "ghcr.io/halo-dev/${name}:${tagName}"
|
||||||
publish = StringUtils.hasText(System.getenv('GHCR_TOKEN'))
|
publish = StringUtils.hasText(System.getenv('GHCR_TOKEN'))
|
||||||
if (!isRelease) {
|
if (!isRelease) {
|
||||||
tags = ["ghcr.io/halo-dev/${name}:cnb-main".toString()]
|
tags = ["ghcr.io/halo-dev/${name}:${branchName}-cnb".toString()]
|
||||||
}
|
}
|
||||||
docker {
|
docker {
|
||||||
publishRegistry {
|
publishRegistry {
|
||||||
|
@ -228,7 +229,7 @@ tasks.register('publishToDockerHub', BootBuildImage) {
|
||||||
imageName = "halohub/${name}:${tagName}"
|
imageName = "halohub/${name}:${tagName}"
|
||||||
publish = StringUtils.hasText(System.getenv('DOCKER_TOKEN'))
|
publish = StringUtils.hasText(System.getenv('DOCKER_TOKEN'))
|
||||||
if (!isRelease) {
|
if (!isRelease) {
|
||||||
tags = ["halohub/${name}:cnb-main".toString()]
|
tags = ["halohub/${name}:${branchName}-cnb".toString()]
|
||||||
}
|
}
|
||||||
docker {
|
docker {
|
||||||
publishRegistry {
|
publishRegistry {
|
||||||
|
|
Loading…
Reference in New Issue