Skip to content

Commit

Permalink
add configurationRef parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisVQ committed Sep 25, 2024
1 parent 71fd5d7 commit 28623c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion tests/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ properties([
defaultValue: '4.x',
description: 'Enter the reference for the quickstarter (e.g., branch, tag, or commit)'
),
string(
name: 'configurationRef',
defaultValue: 'master',
description: 'Enter the reference for the configuration (e.g., branch, tag, or commit)'
),
string(
name: 'Project',
description: 'Enter the project name (in lower case) where the quickstarter will be provisioned'
Expand Down Expand Up @@ -61,6 +66,8 @@ def quickstarter = params.Quickstarter
def odsNamespace = params.ODS_NAMESPACE
// odsReference
def odsRef = params.quickstarterRef?:"master"
// configurationReference
def confRef = params.configurationRef?:"master"
// QS repo
def QUICKSTARTER_REPO = params.QuickstarterRepository

Expand All @@ -69,7 +76,7 @@ def QUICK_STARTERS_URL = "${ODS_URL}/${QUICKSTARTER_REPO}.git"
def QUICK_STARTERS_BRANCH = "${quickstarterRef}"

def ODS_CONFIGURATION_URL = "${ODS_URL}/ods-configuration.git"
def ODS_CONFIGURATION_BRANCH = "${quickstarterRef}"
def ODS_CONFIGURATION_BRANCH = "${confRef}"

def ODS_CORE_URL = "${ODS_URL}/ods-core.git"
def ODS_CORE_BRANCH = "${quickstarterRef}"
Expand Down
3 changes: 2 additions & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PARALLEL := 1
PROJECT := unitt
SONAR_PROFILE := "Sonar way"
QUICKSTARTER_REPOSITORY := ods-quickstarters
configurationRef := master

## Full test of existing ODS core installation. Caution: Creates UNITT project and ODSVERIFY project.
test: smoketest verify test-create-projects
Expand Down Expand Up @@ -43,7 +44,7 @@ test-create-projects:
## Create Jenkins pipeline using REST API
jenkins-pipeline:
@(envsubst < jenkinsPipelineCreation.sh)
@(./jenkinsPipelineCreation.sh -p $(PROJECT) -q $(QUICKSTARTER_REPOSITORY) -s $(SONAR_PROFILE))
@(./jenkinsPipelineCreation.sh -p $(PROJECT) -q $(QUICKSTARTER_REPOSITORY) -s $(SONAR_PROFILE) -c $(configurationRef))
.PHONY: jenkins-pipeline

## Run quickstarter tests within existing ODS installation. Depends on UNITT project (default).
Expand Down
5 changes: 5 additions & 0 deletions tests/jenkinsPipelineCreation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -eux

PROJECT=""
QuickstarterRepository=""
configurationRef=""
SONAR_QUALITY_PROFILE=""
ODS_GIT_REF="$ODS_GIT_REF"
BITBUCKET_URL="$BITBUCKET_URL"
Expand All @@ -15,6 +16,9 @@ while [[ "$#" > 0 ]]; do case $1 in
-g=*|--ods-git-ref=*) ODS_GIT_REF="${1#*=}";;
-g|--ods-git-ref) ODS_GIT_REF="$2"; shift;;

-c=*|--configurationRef=*) configurationRef="${1#*=}";;
-c|--configurationRef) configurationRef="$2"; shift;;

-b=*|--bitbucket=*) BITBUCKET_URL="${1#*=}";;
-b|--bitbucket) BITBUCKET_URL="$2"; shift;;

Expand Down Expand Up @@ -45,6 +49,7 @@ esac; shift; done
tailor --namespace=${PROJECT}-cd --non-interactive \
apply \
--param=ODS_GIT_REF=${ODS_GIT_REF} \
--param=configurationRef=${configurationRef} \
--param=PROJECT=${PROJECT} \
--param=BITBUCKET_URL=${BITBUCKET_URL} \
--param=ODS_NAMESPACE=${ODS_NAMESPACE} \
Expand Down

0 comments on commit 28623c2

Please sign in to comment.