提交 337b4866 编写于 作者: zhangsiyuan's avatar zhangsiyuan

Update uat-phome.jenkinsfile

上级 2c05f0d3
#!groovy
// User-defined Variables:
def ip = "192.168.121.117"
// Git Repository
def repoUrl = "$git"
......@@ -11,14 +10,14 @@ 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"
// vue 环境变量
def ENV_MAP = ["dev": "dev", "test": "testing","uat": "uat","prod": "production","release": "production"]
def ENV_MAP = ["dev": "dev", "test": "testing", "itest":"pre","pre": "pre","prod": "production","release": "production"]
def vueAppEnv = ENV_MAP."${envProfile}"
// Set default variable IMAGE_TAG
......@@ -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
......@@ -102,11 +101,14 @@ pipeline{
// Update app
stage('deploy'){
when { expression { envProfile ==~ /test|uat/ }}
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.166"
PROJECT=`echo $JOB_NAME | awk -F[\'_\'] \'{ print $3 }\'`
rsync -av $WORKSPACE/dist/* root@$ip:/usr/share/nginx/html/$PROJECT/
'''
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册