From 02809b26a8e96433dcea87b16918ffc3f68bd743 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Fri, 23 Aug 2019 08:36:56 -0400 Subject: [PATCH] Add pre-build scripts to Python templates New parameter pre-build-script accepts a shell script that can install prerequisite libraries, rearrange the source tree to cope with nested projects, etc. Change-Id: I1fd7c2c094a664244e697ff5a61b82a2e7752faa Signed-off-by: Lott, Christopher (cl778h) --- docs/jjb/lf-python-jobs.rst | 9 +++++++++ jjb/lf-python-jobs.yaml | 6 ++++++ .../notes/lf-python-jobs-pre-build-scripts-c83acd3442266475.yaml | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/lf-python-jobs-pre-build-scripts-c83acd3442266475.yaml diff --git a/docs/jjb/lf-python-jobs.rst b/docs/jjb/lf-python-jobs.rst index 2845e06b..15c5b088 100644 --- a/docs/jjb/lf-python-jobs.rst +++ b/docs/jjb/lf-python-jobs.rst @@ -95,6 +95,9 @@ IQ Server. :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) + :pre-build-script: Shell script to execute before the CLM builder. + For example, install prerequisites or move files to the repo root. + (default: a string with only a comment) :stream: Keyword used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. @@ -168,6 +171,9 @@ https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import :mvn-global-settings: The name of the Maven global settings to use for Maven configuration. (default: global-settings) :mvn-version: Version of maven to use. (default: mvn35) + :pre-build-script: Shell script to execute before the Sonar builder. + For example, install prerequisites or move files to the repo root. + (default: a string with only a comment) :stream: Keyword used to represent a release code-name. Often the same as the branch. (default: master) :submodule-recursive: Whether to checkout submodules recursively. @@ -216,6 +222,9 @@ following pyenv variables before running. :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in minutes before aborting build. (default: 10) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :pre-build-script: Shell script to execute before the Tox builder. + For example, install prerequisites or move files to the repo root. + (default: a string with only a comment) :python-version: Version of Python to configure as a base in virtualenv. (default: python3) :stream: Keyword representing a release code-name. diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index 0c403262..0f38b035 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -77,6 +77,7 @@ java-version: openjdk8 nexus-iq-cli-version: 1.44.0-01 nexus-iq-namespace: "" # Recommend a trailing dash when set. Example: odl- + pre-build-script: "# pre-build script goes here" stream: master submodule-recursive: true submodule-timeout: 10 @@ -115,6 +116,7 @@ builders: - lf-update-java-alternatives: java-version: "{java-version}" + - shell: "{pre-build-script}" - lf-infra-clm-python: clm-project-name: "{nexus-iq-namespace}{project-name}" @@ -223,6 +225,7 @@ git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" java-version: openjdk8 + pre-build-script: "# pre-build script goes here" python-version: python2 mvn-global-settings: global-settings mvn-settings: "{mvn-settings}" @@ -275,6 +278,7 @@ - lf-infra-pre-build - lf-infra-tox-install: python-version: "{python-version}" + - shell: "{pre-build-script}" - shell: !include-raw-escape: ../shell/tox-run.sh - lf-provide-maven-settings: global-settings-file: "{mvn-global-settings}" @@ -404,6 +408,7 @@ git-url: "$GIT_URL/$GERRIT_PROJECT" github-url: "https://github.com" parallel: true + pre-build-script: "# pre-build script goes here" python-version: python2 stream: master submodule-recursive: true @@ -455,6 +460,7 @@ - lf-infra-pre-build - lf-infra-tox-install: python-version: "{python-version}" + - shell: "{pre-build-script}" - shell: !include-raw-escape: ../shell/tox-run.sh publishers: diff --git a/releasenotes/notes/lf-python-jobs-pre-build-scripts-c83acd3442266475.yaml b/releasenotes/notes/lf-python-jobs-pre-build-scripts-c83acd3442266475.yaml new file mode 100644 index 00000000..19081638 --- /dev/null +++ b/releasenotes/notes/lf-python-jobs-pre-build-scripts-c83acd3442266475.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Add pre-build-script parameter to python clm, tox and sonar templates. + Gives flexibility to install prerequisite libraries, rearrange the + source tree, etc. -- 2.16.6