Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Jenkins在重新运行/重播回滚时跳过阶段_Linux_Laravel_Ubuntu_Jenkins_Automation - Fatal编程技术网

Linux Jenkins在重新运行/重播回滚时跳过阶段

Linux Jenkins在重新运行/重播回滚时跳过阶段,linux,laravel,ubuntu,jenkins,automation,Linux,Laravel,Ubuntu,Jenkins,Automation,我有一个类似下面的Jenkins文件,可以自动执行git pull: pipeline { agent any } stages { stage("Code Checkout") { steps { script { notifyBuild('STARTED') if (env.BRA

我有一个类似下面的Jenkins文件,可以自动执行git pull:

pipeline {
         agent any
    }
    stages {
        stage("Code Checkout") {
            steps {
                script {
                    notifyBuild('STARTED')
                        if (env.BRANCH_NAME == 'test') {
                            checkout scm
                        } else if (env.BRANCH_NAME == 'production') {
                            checkout scm
                        } else {
                            sh 'echo \"environment server not match\" && exit 1'
                        }
                }
            }
        }
        stage("Deploy") {
            steps {
                script {
                        if (env.BRANCH_NAME == 'test') {
                            sh 'ssh root@192.168.1.1 "cd /var/www/html/laravel && git pull origin \$BRANCH_NAME"'
                        } else if (env.BRANCH_NAME == 'production') {
                            sh 'ssh root@192.168.1.2 "cd /var/www/html/laravel && git pull origin \$BRANCH_NAME"'
                        } else {
                              sh 'echo \"environment server not match\" && exit 1'
                        }
                }
            }
        }
然后,我想使用git reset命令添加一个回滚阶段--hard$git_COMMIT

我希望此阶段仅在重播或重新运行期间运行。。当用户单击“重新运行”或“重播”时,仅执行此阶段。。将跳过部署阶段和其他阶段。怎么做

请帮忙