Created
March 11, 2020 00:30
-
-
Save HwDhyeon/9c316c0d45746b23bc1e36b31d03d86e to your computer and use it in GitHub Desktop.
젠킨스 빌드 시 파라미터가 존재하는지 확인하고 없다면 기본값 설정하기
This file contains 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
def MY_VARIABLE = null | |
if(env.my_parameter) { | |
MY_VARIABLE = env.my_parameter | |
} else { | |
MY_VARIABLE = "default value" | |
} | |
echo "parameter set: ${MY_VARIABLE}" | |
pipeline { | |
agent any | |
stages { | |
stage('Parameter Check') { | |
steps { | |
echo "${MY_VARIABLE}" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment