簡體   English   中英

使用Jenkins Groovy管道腳本中的ci-game

[英]Use ci-game from Jenkins groovy pipeline script

Jenkins持續集成游戲插件 (ci-game)如何在Jenkins管道中用作代碼(Jenkinsfile)作業?

不幸的是,ci-game插件尚不支持管道。 該插件未出現在“ 與管道兼容插件”列表中。

這個問題已經有一張公開票( JENKINS-42683 )。

單階段的簡單Jenkins聲明式管道

pipeline {
    agent any 
    stages {
        stage('Stage 1') {
            steps {
                echo 'Hello world!' 
            }
        }
    }
}

具有多個階段的簡單Jenkins聲明式管道

pipeline {
    agent any 
    stages {
        stage('Stage 1') {
            steps {
                echo 'Inside Stage 1' 
            }
        }
       stage('Stage 2') {
            steps {
                echo 'Inside Stage 2' 
            }
        }
    }
}

具有Post Action的簡單Jenkins聲明式管道

pipeline {
    agent any 
    stages {
        stage('Stage 1') {
            steps {
                echo 'Inside Stage 1' 
            }
        post {
            failure {
                 script { echo 'failure Inside Stage 1'  }

            }
        success {
             script { echo 'failure Inside Stage 1'  }

        }
      }
    }
   stage('Stage 2') {
        steps {
            echo 'Inside Stage 2' 
        }
       post {
          failure {
              script { echo 'failure Inside Stage 2'  }

          }
          success {
              script { echo 'failure Inside Stage 1'  } 
          }
        }
    }
}

https://devopsdiagnosis.wixsite.com/tech/forum/jenkins/jenkins-pipeline

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM