优化
This commit is contained in:
+4
-1
@@ -170,9 +170,12 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
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
|
||||
? 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 remoteTarget = development ? 'deploy@172.31.198.8' : 'deploy@172.31.198.7'
|
||||
String remoteKey = development
|
||||
|
||||
Reference in New Issue
Block a user