From: Thanh Ha Date: Mon, 15 Oct 2018 22:55:48 +0000 (-0400) Subject: Allow maven-clm job to specify AppID namespace X-Git-Tag: v0.26.0~4^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F86%2F12986%2F1;p=releng%2Fglobal-jjb.git Allow maven-clm job to specify AppID namespace This allows maven-clm jobs to insert a project namespace into the AppID field in Nexus IQ in cases where a Nexus IQ server might be shared by multiple projects and name collision might be an issue. This patch inserts an optional nexus-iq-namespace parameter which by default is blank. This should not break backwards compatibility while allowing the new namespace feature to work. We recommend when using the namespace to add a trailing - to the value. Eg. 'odl-', this is to make the namespace look nice for example "odl-aaa" will be the result of namespace odl-, and project is aaa. Issue: RELENG-1307 Change-Id: If4313ba00da67541d337b70f7946ad6f21fee037 Signed-off-by: Thanh Ha --- diff --git a/docs/jjb/lf-maven-jobs.rst b/docs/jjb/lf-maven-jobs.rst index 6144e050..494d32d0 100644 --- a/docs/jjb/lf-maven-jobs.rst +++ b/docs/jjb/lf-maven-jobs.rst @@ -97,6 +97,10 @@ Produces a CLM scan of the code into Nexus IQ Server. :mvn-opts: Sets MAVEN_OPTS. (default: '') :mvn-params: Additional mvn parameters to pass to the cli. (default: '') :mvn-version: Version of maven to use. (default: mvn35) + :nexus-iq-namespace: Insert a namespace to project AppID for projects that + share a Nexus IQ system to avoid project name collision. We recommend + inserting a trailing - dash if using this parameter. + For example 'odl-'. (default: '') :nexus-iq-stage: Stage the policy evaluation will be run against on the Nexus IQ Server. (default: 'build') :stream: Keyword that can be used to represent a release code-name. diff --git a/docs/jjb/lf-python-jobs.rst b/docs/jjb/lf-python-jobs.rst index 76b45487..c1bf65ab 100644 --- a/docs/jjb/lf-python-jobs.rst +++ b/docs/jjb/lf-python-jobs.rst @@ -86,7 +86,12 @@ IQ Server. :Optional parameters: :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) - :nexus-iq-cli-version: Nexus IQ CLI package version to download and use. (default: 1.44.0-01) + :nexus-iq-cli-version: Nexus IQ CLI package version to download and use. + (default: 1.44.0-01) + :nexus-iq-namespace: Insert a namespace to project AppID for projects that + share a Nexus IQ system to avoid project name collision. We recommend + inserting a trailing - dash if using this parameter. + For example 'odl-'. (default: '') :build-timeout: Timeout in minutes before aborting build. (default: 60) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :java-version: Version of Java to use for the build. (default: openjdk8) diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index eec2bdbc..c5fffb77 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -120,6 +120,7 @@ mvn-opts: '' mvn-params: '' mvn-version: mvn35 + nexus-iq-namespace: '' # Recommend a trailing dash when set. Example: odl- nexus-iq-stage: 'build' stream: master submodule-recursive: true @@ -175,7 +176,7 @@ - nexus-iq-policy-evaluator: stage: '{nexus-iq-stage}' application-type: 'manual' - application-id: '{project-name}' + application-id: '{nexus-iq-namespace}{project-name}' scan-patterns: '{obj:nexus_iq_scan_patterns}' fail-build-network-error: true diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index 7c3251a5..fc342de1 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -78,6 +78,7 @@ github-url: 'https://github.com' java-version: openjdk8 nexus-iq-cli-version: 1.44.0-01 + nexus-iq-namespace: '' # Recommend a trailing dash when set. Example: odl- stream: master submodule-recursive: true @@ -116,7 +117,7 @@ - lf-update-java-alternatives: java-version: '{java-version}' - lf-infra-clm-python: - clm-project-name: '{project-name}' + clm-project-name: '{nexus-iq-namespace}{project-name}' - job-template: name: '{project-name}-python-clm-{stream}' diff --git a/releasenotes/notes/nexus-iq-namespace-f902ea2a8ad46aa2.yaml b/releasenotes/notes/nexus-iq-namespace-f902ea2a8ad46aa2.yaml new file mode 100644 index 00000000..38a2e13e --- /dev/null +++ b/releasenotes/notes/nexus-iq-namespace-f902ea2a8ad46aa2.yaml @@ -0,0 +1,12 @@ +--- +features: + - | + Add a new ``nexus-iq-namespace`` optional parameter to insert a namespace + into Nexus IQ AppID. This is useful for shared Nexus IQ systems where + projects might have concern about namespace collision. + + .. note:: + + We recommend when using the namespace to add a trailing - to the value. + Eg. 'odl-', this is to make the namespace look nice for example + "odl-aaa" is the result of namespace odl-, and project name aaa.