提交 2c05f0d3 编写于 作者: zhangsiyuan's avatar zhangsiyuan

Update test-phome.jenkinsfile

上级 bb0536e2
#!groovy
// User-defined Variables:
def ip = "192.168.140.111"
// Git Repository
def repoUrl = "$git"
......@@ -11,7 +10,7 @@ def repoUrl = "$git"
// -------------------------------------------------------------------------------------
// Public Variables
def CREDENTIALSID = "1fa6bf2e-e790-4262-8632-e119f8919bb9"
def CREDENTIALSID = "cd54b3b5-9773-4fac-8272-f783a4fc24ff"
// Sonar
def SONAR_HOST_URL = "http://192.168.140.201:9000"
......@@ -29,7 +28,7 @@ pipeline{
parameters{
gitParameter branchFilter: 'origin/(master|hotfix.*|feature.*|dev.*|.*est|release.*|pre|prod)', defaultValue: 'release', name: 'refVar', type: 'PT_BRANCH',useRepository: "$repoUrl"
choice(name: 'tagType', choices: ['Patch', 'Minor', 'Major'], description: 'Tag Type')
choice(name: 'envProfile',choices: ['dev','test','uat','prod'],description: 'Environment Type')
choice(name: 'envProfile',choices: ['dev','test','uat', 'prod'],description: 'Environment Type')
}
// Skip Declarative: Checkout SCM stage
......@@ -104,11 +103,15 @@ pipeline{
stage('deploy'){
when { expression { envProfile ==~ /dev|test/ }}
steps{
sh label: '', script: """
rsync -av $WORKSPACE/dist/* root@$ip:/usr/share/nginx/html/phome/$JOB_NAME/
"""
sh label: '', script: '''
ip="192.168.110.48"
PROJECT=`echo $JOB_NAME | awk -F[\'_\'] \'{ print $3 }\'`
rsync -av $WORKSPACE/dist/* root@$ip:/usr/share/nginx/html/$PROJECT/
'''
}
}
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册