From bbc5a834d4b45ccac0d96bd76e32f9010053b9fc Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Wed, 22 Jan 2020 10:06:18 -0500 Subject: [PATCH] Accept maven configuration in Python tox sonar Extend lf_tox_sonar with parameters macro lf-infra-maven-parameters so job definitions can configure mvn-opts, mvn-params and mvn-version values. Default values are defined so existing jobs are not affected. This change makes the python-tox sonar template consistent with the maven sonar template. Extend the PyPI package structure recommendation with a way to share the docs/ folder. Change-Id: I2f785cabc9058238d36505c8b4af8f87114a685a Issue-Id: RELENG-2677 Signed-off-by: Lott, Christopher (cl778h) --- docs/jjb/lf-python-jobs.rst | 23 +++++++++++++++++----- jjb/lf-python-jobs.yaml | 8 +++++++- .../tox-sonar-mvn-params-3d81e313676816c8.yaml | 11 +++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/tox-sonar-mvn-params-3d81e313676816c8.yaml diff --git a/docs/jjb/lf-python-jobs.rst b/docs/jjb/lf-python-jobs.rst index c179366e..117ab387 100644 --- a/docs/jjb/lf-python-jobs.rst +++ b/docs/jjb/lf-python-jobs.rst @@ -369,12 +369,17 @@ paths. For example, a PyPI merge job should not run on a non-Python file change such as documentation, because the job cannot upload the same package twice. +To make the document files available for building a Python package +long description in setup.py, add a symbolic link "docs" in the +package subdirectory pointing to the top-level docs directory. + .. code-block:: bash git-repo-name/ │ ├── docs/ - │ └── index.rst + │ ├── index.rst + │ └── release-notes.rst │ ├── helloworld-package/ │ │ @@ -399,10 +404,10 @@ same package twice. └── README.md -Use of these templates requires a .pypirc configuration file in the -Jenkins builder home directory. An example appears next that uses API -tokens. Note that in the [pypi] entry the repository key-value pair is -optional, it defaults to pypi.org. +Jobs built from the PyPI templates depend on a .pypirc configuration file +in the Jenkins builder home directory. An example appears next that uses +API tokens. Note that in the [pypi] entry the repository key-value pair +is optional, it defaults to pypi.org. .. code-block:: bash @@ -434,6 +439,7 @@ optional, it defaults to pypi.org. :build-node: The node to run the build on. :jenkins-ssh-credential: Credential to use for SSH. (Generally set in defaults.yaml) + :mvn-settings: The settings file with credentials for the project :project: Git repository name :project-name: Jenkins job name prefix @@ -448,6 +454,9 @@ optional, it defaults to pypi.org. :disable-job: Whether to disable the job (default: false) :dist-binary: Whether to build a binary wheel distribution. (default: true) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') + :mvn-params: Parameters to pass to the mvn CLI. (default: '') + :mvn-version: Version of maven to use. (default: mvn35) :parallel: Boolean indicator for tox to run tests in parallel or series. (default: false, in series) :pre-build-script: Shell script to execute before the tox builder. For @@ -507,6 +516,7 @@ pyenv variables before running. :build-node: The node to run the build on. :jenkins-ssh-credential: Credential to use for SSH. (Generally set in defaults.yaml) + :mvn-settings: The settings file with credentials for the project :project: Git repository name :project-name: Jenkins job name prefix @@ -518,6 +528,9 @@ pyenv variables before running. :disable-job: Whether to disable the job (default: false) :dist-binary: Whether to build a binary wheel distribution. (default: true) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '') + :mvn-params: Parameters to pass to the mvn CLI. (default: '') + :mvn-version: Version of maven to use. (default: mvn35) :parallel: Boolean indicator for tox to run tests in parallel or series. (default: false, in series) :pre-build-script: Shell script to execute before the tox builder. For diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index fe06d71c..1b7c63ac 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -215,7 +215,7 @@ ######################### - lf_tox_sonar: &lf_tox_sonar - name: lf-tox_sonar + name: lf-tox-sonar ###################### # Default parameters # @@ -231,6 +231,8 @@ java-version: openjdk8 mvn-global-settings: global-settings mvn-goals: validate + mvn-opts: "" + mvn-params: "" mvn-settings: "{mvn-settings}" mvn-version: mvn35 parallel: true @@ -267,6 +269,10 @@ project: "{project}" branch: "{branch}" stream: "{stream}" + - lf-infra-maven-parameters: + mvn-opts: "{mvn-opts}" + mvn-params: "{mvn-params}" + mvn-version: "{mvn-version}" - lf-infra-tox-parameters: tox-dir: "{tox-dir}" tox-envs: "{tox-envs}" diff --git a/releasenotes/notes/tox-sonar-mvn-params-3d81e313676816c8.yaml b/releasenotes/notes/tox-sonar-mvn-params-3d81e313676816c8.yaml new file mode 100644 index 00000000..1e88681d --- /dev/null +++ b/releasenotes/notes/tox-sonar-mvn-params-3d81e313676816c8.yaml @@ -0,0 +1,11 @@ +--- +fixes: + - | + Extend macro lf_tox_sonar with parameters macro lf-infra-maven-parameters + so job definitions can configure mvn-opts, mvn-params and mvn-version + values. Default values are defined so existing jobs are not affected. + This change makes the python-tox sonar template consistent with the + maven sonar template. + + Extend the PyPI package structure recommendation with a way to share + the docs/ folder. -- 2.16.6