Skip to content

Commit

Permalink
treecompose: detect if buildmaster exists on registry
Browse files Browse the repository at this point in the history
To bootstrap the change to `buildmaster`, we need to do a quick test
if the tag exists on the registry.  If it exists, we can pull from it,
otherwise we need to use `latest`
  • Loading branch information
miabbott committed Sep 28, 2018
1 parent e30a4ed commit ede4d52
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Jenkinsfile.treecompose
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ node(NODE) {
withCredentials([
usernameColonPassword(credentialsId: params.REGISTRY_CREDENTIALS, variable: 'CREDS'),
]) {
sh """./scripts/pull-mount-oscontainer ${API_CI_REGISTRY} ${treecompose_workdir} ${OSCONTAINER_IMG}"""
def (registryUser, registryPass) = "${CREDS}".split(':')
utils.registry_login(registryUser, registryPass, "${API_CI_REGISTRY}")
sh """
if ! skopeo inspect docker://${OSCONTAINER_IMG}:buildmaster; then
./scripts/pull-mount-oscontainer ${API_CI_REGISTRY} ${treecompose_workdir} ${OSCONTAINER_IMG}:latest
else
./scripts/pull-mount-oscontainer ${API_CI_REGISTRY} ${treecompose_workdir} ${OSCONTAINER_IMG}:buildmaster
fi
"""
}
}

Expand Down

0 comments on commit ede4d52

Please sign in to comment.