ci: parameterize docker image prefix

This commit is contained in:
lingniu
2026-07-01 12:43:13 +08:00
parent 9fb77a1aa2
commit dc481e8653
2 changed files with 14 additions and 2 deletions

View File

@@ -45,6 +45,18 @@ class WoodpeckerPipelineTest {
.doesNotContain("-DskipTests");
}
@Test
void dockerPublishUsesOverridableImagePrefix() throws IOException {
String pipeline = Files.readString(repositoryRoot().resolve("woodpecker.yml"));
assertThat(pipeline)
.contains("REGISTRY=${LINGNIU_IMAGE_REGISTRY:-crpi-85r4m0ackrm3qpje.cn-shanghai.personal.cr.aliyuncs.com}")
.contains("NAMESPACE=${LINGNIU_IMAGE_NAMESPACE:-oneos}")
.contains("IMAGE=$REGISTRY/$NAMESPACE/$APP_NAME:$APP_VERSION")
.doesNotContain("\n REGISTRY=crpi-85r4m0ackrm3qpje.cn-shanghai.personal.cr.aliyuncs.com")
.doesNotContain("\n NAMESPACE=oneos");
}
@Test
void dockerImageExposesOnlyCurrentProductionPorts() throws IOException {
String dockerfile = Files.readString(repositoryRoot().resolve("Dockerfile"));