ci: serialize registry-based environment deployments
This commit is contained in:
+8
-1
@@ -167,6 +167,8 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
String deployLock = "firstleg-${params.ENVIRONMENT}-deploy"
|
||||
lock(resource: deployLock, inversePrecedence: true) {
|
||||
boolean development = params.ENVIRONMENT == 'development'
|
||||
boolean testTargetIsLocal = ['master', 'built-in'].contains(env.NODE_NAME) ||
|
||||
['master', 'built-in'].any { label -> env.NODE_LABELS?.tokenize()?.contains(label) }
|
||||
@@ -194,10 +196,15 @@ pipeline {
|
||||
"TARGET_SSH_KNOWN_HOSTS=${remoteKnownHosts}",
|
||||
"TARGET_DEPLOY_DIR=${remoteDir}"
|
||||
]) {
|
||||
withCredentials([file(credentialsId: credentialId, variable: 'DEPLOY_ENV_FILE')]) {
|
||||
withCredentials([
|
||||
file(credentialsId: credentialId, variable: 'DEPLOY_ENV_FILE'),
|
||||
usernamePassword(credentialsId: env.REGISTRY_CREDENTIALS,
|
||||
usernameVariable: 'REGISTRY_USER', passwordVariable: 'REGISTRY_PASSWORD')
|
||||
]) {
|
||||
sh "sh deploy/scripts/deploy-built-service.sh '${params.ENVIRONMENT}' '${env.RESOLVED_IMAGE_REPOSITORY}' '${env.RESOLVED_IMAGE_TAG}' '${env.RESOLVED_SERVICE}' \"\$DEPLOY_ENV_FILE\""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user