From a6c9eaaa228ac75a144b51b74ac34767aa53ed1b Mon Sep 17 00:00:00 2001 From: afenner Date: Wed, 21 Oct 2020 17:04:50 +0100 Subject: [PATCH] Allow verify in specific subdirectory for the cps POC they want to be able to run the verify job on a specific sub directory only. This allows this capabilty to be used in any verify job but is off by default and turn it on for the cps_poc job Change-Id: Iafacb7caa201ae073085cc3b8181c6210af19d08 Signed-off-by: afenner --- .../ccsdk-features/ccsdk-features-verify-jobs.yaml | 1 + jjb/onap/global-templates-onap-java.yaml | 5 +++++ jjb/onap/verify-jobs.sh | 11 ++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/jjb/onap/ccsdk-features/ccsdk-features-verify-jobs.yaml b/jjb/onap/ccsdk-features/ccsdk-features-verify-jobs.yaml index f21946ed..55f8613f 100644 --- a/jjb/onap/ccsdk-features/ccsdk-features-verify-jobs.yaml +++ b/jjb/onap/ccsdk-features/ccsdk-features-verify-jobs.yaml @@ -31,5 +31,6 @@ - cps_poc: branch: '{stream}' jdk-version: java-11 + subdirectory: cps jobs: - 'onap-{project-name}-{stream}-verify-java' diff --git a/jjb/onap/global-templates-onap-java.yaml b/jjb/onap/global-templates-onap-java.yaml index b2887356..49254f22 100644 --- a/jjb/onap/global-templates-onap-java.yaml +++ b/jjb/onap/global-templates-onap-java.yaml @@ -7,6 +7,7 @@ concurrent: true mvn_settings_xml_version: mvn_params: + subdirectory: properties: - logrotate @@ -39,6 +40,10 @@ name: MVN_PARAMS default: '{mvn_params}' description: Maven build parameters + - string: + name: SUBDIRECTORY + default: '{subdirectory}' + description: Subdirectory of the workspace for which the pom.xml will be called. This allows the verify to be called against a specific directory scm: - git-scm-gerrit: ssh-credentials-id: nordixinfra-nordix-gerrit-ssh diff --git a/jjb/onap/verify-jobs.sh b/jjb/onap/verify-jobs.sh index edd6622c..5cb0b004 100755 --- a/jjb/onap/verify-jobs.sh +++ b/jjb/onap/verify-jobs.sh @@ -42,7 +42,16 @@ if [ ! -d /home/jenkins/.m2 ]; then fi cp settings.xml /home/jenkins/.m2/settings.xml cd $WORKSPACE + +POMFILE="-f $WORKSPACE/pom.xml" +set +o nounset +if [[ -n ${SUBDIRECTORY} ]]; then + POMFILE="-f $WORKSPACE/$SUBDIRECTORY/pom.xml" + echo "Setting pom.xml to use to $POMFILE" +fi +set -o nounset + echo "----------------------------------------------------" echo "Proceeding with unit test" echo "----------------------------------------------------" -$MVN clean install -U -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn $LOCAL_MVN_PARAMS +$MVN clean install -U -B $POMFILE -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn $LOCAL_MVN_PARAMS -- 2.25.1