Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default VARIABLE_FILE parameter #18117

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions buildenv/jenkins/common/variables-functions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,9 @@ pipelineFunctions = load 'buildenv/jenkins/common/pipeline-functions.groovy'
* platforms.
*/
def parse_variables_file() {
DEFAULT_VARIABLE_FILE = "buildenv/jenkins/variables/defaults.yml"

// check if a variable file is passed as a Jenkins build parameter
// if not use default configuration settings
VARIABLE_FILE = get_variables_file()
if (!VARIABLE_FILE) {
VARIABLE_FILE = "${DEFAULT_VARIABLE_FILE}"
}

if (!fileExists("${VARIABLE_FILE}")) {
error("Missing variable file: ${VARIABLE_FILE}")
Expand All @@ -230,13 +225,13 @@ def parse_variables_file() {
* Fetch the user provided variable file.
*/
def get_variables_file() {
VARIABLE_FILE = (params.VARIABLE_FILE) ? params.VARIABLE_FILE : ""
VARIABLE_FILE = params.VARIABLE_FILE ?: "buildenv/jenkins/variables/defaults.yml"
echo "VARIABLE_FILE:'${VARIABLE_FILE}'"
VENDOR_REPO = (params.VENDOR_REPO) ? params.VENDOR_REPO : ""
VENDOR_REPO = params.VENDOR_REPO ?: ""
echo "VENDOR_REPO:'${VENDOR_REPO}'"
VENDOR_BRANCH = (params.VENDOR_BRANCH) ? params.VENDOR_BRANCH : ""
VENDOR_BRANCH = params.VENDOR_BRANCH ?: ""
echo "VENDOR_BRANCH:'${VENDOR_BRANCH}'"
VENDOR_CREDENTIALS_ID = (params.VENDOR_CREDENTIALS_ID) ? params.VENDOR_CREDENTIALS_ID : ""
VENDOR_CREDENTIALS_ID = params.VENDOR_CREDENTIALS_ID ?: ""
echo "VENDOR_CREDENTIALS_ID:'${VENDOR_CREDENTIALS_ID}'"
if (VARIABLE_FILE && VENDOR_REPO && VENDOR_BRANCH) {
if (VENDOR_CREDENTIALS_ID) {
Expand Down