Created
February 27, 2011 08:25
-
-
Save tyuki39/846018 to your computer and use it in GitHub Desktop.
Jenkinsでプロジェクト固有の環境変数を取得する方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// プラクティスとして良いかどうかは別として、他のプロジェクト固有の環境変数を得る方法 | |
// 以下は groovy plugin の Execute system Groovy script の中で使用して | |
// TEST プロジェクトの WORKSPACE 環境変数の情報を得る例 | |
def jobname = "TEST" | |
def envname = "WORKSPACE" | |
def job = hudson.model.Hudson.instance.getItem(jobname) | |
def envVars= job.lastBuild.properties.get("envVars") | |
println envVars[envname] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment