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/
│ │
└── 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
: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
: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
: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
: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
jenkins-ssh-credential: "{jenkins-ssh-credential}"
builders:
- - lf-pip-install:
- pip-packages: jenkins-job-builder
- lf-infra-jjbini
- shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
- file-id: "{settings-file}"
variable: "SETTINGS_FILE"
-- builder:
- name: lf-pip-install
- builders:
- - inject:
- properties-content: PIP_PACKAGES={pip-packages}
- - shell: !include-raw-escape: ../shell/pip-install.sh
-
- builder:
name: lf-provide-maven-settings-cleanup
builders:
#########################
- lf_tox_sonar: &lf_tox_sonar
- name: lf-tox_sonar
+ name: lf-tox-sonar
######################
# Default parameters #
java-version: openjdk8
mvn-global-settings: global-settings
mvn-goals: validate
+ mvn-opts: ""
+ mvn-params: ""
mvn-settings: "{mvn-settings}"
mvn-version: mvn35
parallel: true
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}"
--- /dev/null
+---
+fixes:
+ - |
+ Disable the pip install warning that are not useful in the console logs.
+
+ 00:25:10 WARNING: The scripts easy_install and easy_install-3.6 are installed in '/home/jenkins/.local/bin' which is not on PATH.
+ 00:25:10 Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
--- /dev/null
+---
+fixes:
+ - |
+ Revise shell script maven-javadoc-generate.sh to supply -f
+ argument to maven with argument translated by call to readlink.
+ This works around the javadoc:aggregate behavior of silently
+ doing nothing if invoked "-f ."
--- /dev/null
+---
+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.
--- /dev/null
+---
+fixes:
+ - |
+ The jjb-deploy-job.sh was 'activating' a venv that was created by
+ pip-install.sh in /tmp/v. This venv was based on python2. Now
+ jjb-deploy-job.sh calls lf-activate-venv() to install jenkins-jobs in a
+ venv based on python3.
+upgrade:
+ - |
+ The lf-pip-install builder macro has been deleted. At some point we will
+ also be deleting shell/pip-install.sh.
export PYENV_VERSION="3.6.4"
fi
-$pip install --user niet
-$pip install --user lftools
-$pip install --user lftools[nexus]
-$pip install --user jsonschema
+$pip install niet
+$pip install lftools
+$pip install lftools[nexus]
+$pip install jsonschema
echo "Checking votes:"
lftools infofile check-votes INFO.yaml "$GERRIT_URL" "$ref" > gerrit_comment.txt
echo "---> jjb-deploy-job.sh"
# Ensure we fail the job if any steps fail.
-set -e -o pipefail
+set -uef -o pipefail
-# shellcheck source=/tmp/v/jenkins-job-builder/bin/activate disable=SC1091
-source "/tmp/v/jenkins-job-builder/bin/activate"
+# shellcheck disable=SC1090
+source ~/lf-env.sh
+
+# Version controlled by JJB_VERSION
+lf-activate-venv jenkins-job-builder
# Fetch patch if gerrit project matches the jjb-deploy project
if [ "${GERRIT_PROJECT}" == "${PROJECT}" ]; then
echo "INFO: Retrieving Pricing Info for: $instance_type"
url="https://pricing.vexxhost.net/v1/pricing/$instance_type/cost?seconds=$uptime"
-jason_block=$(curl -s "$url")
+json_block=$(curl -s "$url")
-cost=$(jq .cost <<< "$jason_block")
-resource=$(jq .resource <<< "$jason_block" | tr -d '"')
+cost=$(jq .cost <<< "$json_block")
+resource=$(jq .resource <<< "$json_block" | tr -d '"')
# Archive the cost date
mkdir -p "$WORKSPACE/archives/cost"
export MAVEN_OPTS
+# use absolute path as workaround for javadoc:aggregate
+# silent failure on relative path, for example "-f ."
+maven_dir_abs=$(readlink -f "$MAVEN_DIR")
+
# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
# shellcheck disable=SC2086
# Use -x via subshell to show maven invocation details in the log
(set -x
$MVN clean install javadoc:aggregate \
+ -f "$maven_dir_abs" \
-e -Pq -Dmaven.javadoc.skip=false \
-DskipTests=true \
-Dcheckstyle.skip=true \
-Dfindbugs.skip=true \
--global-settings "$GLOBAL_SETTINGS_FILE" \
--settings "$SETTINGS_FILE" \
- -f "$MAVEN_DIR" \
- $MAVEN_OPTIONS $MAVEN_PARAMS \
+ $MAVEN_OPTIONS $MAVEN_PARAMS
)
mv "$WORKSPACE/$MAVEN_DIR/target/site/apidocs" "$JAVADOC_DIR"
# Use `python -m pip` to ensure we are using pip from user venv
python3 -m venv ~/.local
- python3 -m pip install --user --quiet --upgrade pip
- python3 -m pip install --user --quiet --upgrade setuptools
- python3 -m pip install --user --quiet --upgrade --upgrade-strategy eager -r "$requirements_file"
+ python3 -m pip install --quiet --upgrade pip
+ python3 -m pip install --quiet --no-warn-script-location --upgrade setuptools
+ python3 -m pip install --quiet --no-warn-script-location --upgrade --upgrade-strategy eager -r "$requirements_file"
rm -rf "$requirements_file"
touch /tmp/pre-build-complete
fi
if [[ $JOB_NAME == "lf-infra-lftools-rtd-verify-any" ]]; then
# Install patchset lftools
- python3 -m pip install --user -e .
+ python3 -m pip install -e .
fi
echo "---> Generating docs"
if [[ $PYTHON == "python2" ]]; then
- $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
+ $PYTHON -m pip install --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
else
- $PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv
+ $PYTHON -m pip install --quiet --upgrade tox tox-pyenv virtualenv
fi