Add pre-build scripts to Python templates 52/16652/3
authorLott, Christopher (cl778h) <cl778h@att.com>
Fri, 23 Aug 2019 12:36:56 +0000 (08:36 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Fri, 23 Aug 2019 23:44:58 +0000 (19:44 -0400)
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) <cl778h@att.com>
docs/jjb/lf-python-jobs.rst
jjb/lf-python-jobs.yaml
releasenotes/notes/lf-python-jobs-pre-build-scripts-c83acd3442266475.yaml [new file with mode: 0644]

index 2845e06..15c5b08 100644 (file)
@@ -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.
index 0c40326..0f38b03 100644 (file)
@@ -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
     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}"
 
     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}"
       - 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}"
     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
       - 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 (file)
index 0000000..1908163
--- /dev/null
@@ -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.