jenkins pipeline 写法

pipeline {
   agent any

   stages {
        stage('合服') {
           steps {
                sh '''
                    sh /data/fytx_hefuceshi_s005a/script/hefu/jenkin_script.bak/merge.sh
                '''
            }
        }
        stage('重启后台游戏服') {
            input {
                message "是否修改后台配置?"
                ok "已修改"
                submitter "root,majunjie"
            }
            steps {
                sh '''
                    ssh -o StrictHostKeyChecking=no root@10.21.210.105 \'PATH=/usr/local/python2.7/bin:$PATH ; cd /home/game_analys && sh uwsgi_reboot.sh && cd /home/game_service && sh uwsgi_reboot.sh\'
                    cd /data/fytx_hefuceshi_s005a/py_service && sh login_service.sh restart && sh pay_service.sh restart && \
                    cd /data/fytx_hefuceshi_s005a/server && ./start.sh
                  '''
            }
        }
        stage('还原') {
            input {
                message "测试完成,后台配置是否还原?"
                ok "已还原"
                submitter "root,majunjie"
            }
            steps {
                sh '''
                    ssh -o StrictHostKeyChecking=no root@10.21.210.105 'PATH=/usr/local/python2.7/bin:$PATH ;cd /home/game_analys && sh uwsgi_reboot.sh && cd /home/game_service && sh uwsgi_reboot.sh'
                    cd /data/fytx_hefuceshi_s005a/script/hefu/jenkin_script.bak/ && sh recover.sh
                '''
            }
        }
    }
}

 

相关文章

基础环境、流程图1)流程图jenkinspipeline发布应用2)、jenki...
本节是建立在流水线入门内容的基础上,而且,应当被当作一个...
Linuxcentos7安装Jenkins(jenkins-2.227-1.1.noarch.rpm)时遇...
作为一个拥有很多账号的当代美少女,忘记用户名密码什么的是...
Jenkins、GitLab和Maven(Nexus)完成自动构建迈向持续集成持...
 下载文档https://www.jenkins.io/zh/download/  Debian下...