Merge branch 'test' of http://8.163.30.128:10082/java-project/baiyue-firstleg into dev
This commit is contained in:
+4
-1
@@ -170,9 +170,12 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
boolean development = params.ENVIRONMENT == 'development'
|
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) }
|
||||||
boolean targetIsLocal = development
|
boolean targetIsLocal = development
|
||||||
? env.NODE_LABELS?.tokenize()?.contains('java-dev')
|
? env.NODE_LABELS?.tokenize()?.contains('java-dev')
|
||||||
: env.NODE_NAME == 'master'
|
: testTargetIsLocal
|
||||||
|
echo "构建节点 ${env.NODE_NAME} 部署到 ${params.ENVIRONMENT},目标是否为本机: ${targetIsLocal}"
|
||||||
String credentialId = "firstleg-${params.ENVIRONMENT}-env"
|
String credentialId = "firstleg-${params.ENVIRONMENT}-env"
|
||||||
String remoteTarget = development ? 'deploy@172.31.198.8' : 'deploy@172.31.198.7'
|
String remoteTarget = development ? 'deploy@172.31.198.8' : 'deploy@172.31.198.7'
|
||||||
String remoteKey = development
|
String remoteKey = development
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ test('production deployments cannot skip tests', () => {
|
|||||||
test('Java builds use the shared builder pool and deploy on the target environment node', () => {
|
test('Java builds use the shared builder pool and deploy on the target environment node', () => {
|
||||||
assert.match(pipeline, /agent \{ label 'java-builder' \}/)
|
assert.match(pipeline, /agent \{ label 'java-builder' \}/)
|
||||||
assert.match(pipeline, /\['development', 'test'\]\.contains\(params\.ENVIRONMENT\)/)
|
assert.match(pipeline, /\['development', 'test'\]\.contains\(params\.ENVIRONMENT\)/)
|
||||||
|
assert.match(pipeline, /\['master', 'built-in'\]\.contains\(env\.NODE_NAME\)/)
|
||||||
assert.match(pipeline, /deploy-built-service\.sh/)
|
assert.match(pipeline, /deploy-built-service\.sh/)
|
||||||
assert.match(directDeployScript, /docker save "\$IMAGE" \| gzip -1 \| run_ssh/)
|
assert.match(directDeployScript, /docker save "\$IMAGE" \| gzip -1 \| run_ssh/)
|
||||||
assert.match(directDeployScript, /--pull never/)
|
assert.match(directDeployScript, /--pull never/)
|
||||||
|
|||||||
Reference in New Issue
Block a user