LoginSignup
0
2

More than 3 years have passed since last update.

JenkinsFileのテンプレ

Posted at

テンプレ

JenkinsのPipelineを書くのにテンプレが欲しかったので備忘録に

pipeline {
    agent any
    environment {
    // Globalな変数宣言
    }
    stages {
        //  template
        stage ('stage name') {
            when {
                expression {
                    // 条件を満たす時のみ実行される
                    return true
                }
            }
            environment {
                //このstageでのみ有効な変数宣言
            }
            steps {
                // Timestamperプラグインの出力がされる
                timestamps {
                    script {
                    }
                }
            }
        }
    }
}

注意点

toBoolean() を使う場合は Use Groovy Sandbox のチェックは外すこと

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2