11 This macro will post a comment to the gerrit patchset if the build
12 creates a file named gerrit_comment.txt
13 To use this macro add it to the list of builders.
16 lf-fetch-dependent-patches
17 --------------------------
19 Fetch all patches provided via comment trigger
21 This macro will fetch all patches provided via comment trigger and will
22 create a list of projects from those patches via environment variable
23 called ``DEPENDENCY_BUILD_ORDER`` to build projects in the specified order.
24 Order calculated by the first patch instance for a project in the patch list.
33 :file-patterns: Space-separated list of file patterns to scan.
34 For example: \*.go \*.groovy \*.java \*.py \*.sh
35 :spdx-disable: Disable the SPDX-Identifier checker.
36 :lhc-version: Version of LHC to use.
37 :license-exclude-paths: Comma-separated list of paths to exclude from the
38 license checker. Matches the paths defined here using a contains rule,
39 we recommend you to configure as precisely as possible. For example
40 a path of '/src/generated/' will search as '**/src/generated/**'.
41 Example: org/opendaylight/yang/gen,protobuff/messages
42 :licenses-allowed: Comma-separated list of allowed licenses.
43 For example: Apache-2.0,EPL-1.0,MIT
45 lf-infra-capture-instance-metadata
46 ----------------------------------
48 Capture instance metadata.
53 Create a ~/.netrc file from a Maven settings.xml
57 :server-id: The id of a server as defined in settings.xml.
61 :ALT_NEXUS_SERVER: URL of custom nexus server.
62 If set this will take precedence.
63 Use this to point at nexus3.$PROJECTDOMAIN
66 lf-infra-deploy-maven-file
67 --------------------------
69 Deploy files to a repository.
73 :global-settings-file: Global settings file to use.
74 :group-id: Group ID of the repository.
75 :maven-repo-url: URL of a Maven repository to upload to.
76 :mvn-version: Version of Maven to use.
77 :repo-id: Repository ID
78 :settings-file: Maven settings file to use.
79 :upload-files-dir: Path to directory containing one or more files
84 Login into a custom hosted docker registry and / or docker.io
86 The Jenkins system should have the following global variables defined
88 :Environment variables:
90 :DOCKER_REGISTRY: The DNS address of the registry (IP or FQDN)
91 ex: nexus3.example.com (GLOBAL variable)
93 :REGISTRY_PORTS: Required when setting ``DOCKER_REGISTRY``. Space-separated
94 list of the registry ports to login to. ex: 10001 10002 10003 10004
97 :DOCKERHUB_EMAIL: If set, then the job will attempt to login to DockerHub
98 (docker.io). Set to the email address for the credentials that will
99 get looked up. Returns the _first_ credential from the maven settings
100 file for DockerHub. (GLOBAL variable)
102 lf-infra-gpg-verify-git-signature
103 ---------------------------------
105 Verify gpg signature of the latest commit message in $WORKSPACE.
106 This command assumes that $WORKSPACE is a git repo.
111 Macro that runs before all builders to prepare the system for job use.
113 lf-infra-package-listing
114 ------------------------
116 Lists distro level packages.
118 lf-infra-packer-build
119 ---------------------
121 Run `packer build` to build system images.
123 :Required parameters:
125 :openstack: Packer template uses an OpenStack builder (true|false).
126 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
127 :packer-version: Version of packer to use.
128 :platform: Build platform as found in the vars directory.
129 :template: Packer template to build as found in the templates directory.
131 :Optional parameters:
133 :update-cloud-image: Submit a change request to update new built cloud
136 lf-infra-packer-validate
137 ------------------------
139 Run ``packer validate`` to verify packer configuration.
141 :Required parameters:
143 :openstack: Packer template uses an OpenStack builder (true|false).
144 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
145 :packer-cloud-settings: Cloud configuration file. Loaded on the build
146 server as CLOUDENV environment variable.
147 :packer-version: Version of packer to use.
149 lf-infra-push-gerrit-patch
150 --------------------------
152 Push a change through a Jenkins job to a Gerrit repository in an automated
153 way using git-review.
155 :Required parameters:
157 :gerrit-commit-message: Commit message to assign.
158 :gerrit-host: Gerrit hostname.
159 :gerrit-topic: Gerrit topic.
160 :gerrit-user: Gerrit user-id used for submitting the change.
161 :reviewers-email: Reviewers email. Space-separated list of
162 email addresses to CC on the patch.
163 :project: Gerrit project name.
165 .. _lf-infra-ship-logs:
170 Gather and deploy logs to a log server.
175 Retrieves system stats.
177 lf-infra-update-packer-images
178 -----------------------------
180 Find and update the new built cloud image{s} in the ci-management source
184 lf-jacoco-nojava-workaround
185 ---------------------------
187 Workaround for Jenkins not able to find Java in JaCoCo runs.
189 .. _lf-maven-central:
194 Publish artifacts to OSSRH (Maven Central) staging.
196 Requires that the project's settings.xml contains a ServerId 'ossrh' with the
197 credentials for the project's OSSRH account.
199 This macro assumes the directory ``$WORKSPACE/m2repo`` contains a Maven 2
200 repository which is to upload to OSSRH.
202 :Required parameters:
204 :mvn-central: Set to ``true`` to upload to mvn-central. (true|false)
205 :mvn-global-settings: The name of the Maven global settings to use for
206 Maven configuration. (default: global-settings)
207 :mvn-settings: The name of settings file containing credentials for the
209 :ossrh-profile-id: Nexus staging profile ID as provided by OSSRH.
211 .. literalinclude:: ../../.jjb-test/lf-macros/lf-maven-central-minimal.yaml
214 .. _lf-maven-install:
219 Call maven-target builder with a goal of ``--version`` to force Jenkins to
220 install the declared version of Maven. Use this as a preparation step for
221 any shell scripts that want to use Maven.
223 :Required parameters:
225 :mvn-version: Version of Maven to install.
227 lf-packagecloud-file-provider
228 -----------------------------
230 Provisions files required by the Ruby gem package_cloud, namely
231 ".packagecloud" and "packagecloud_api" in the Jenkins home directory.
236 Pushes DEB/RPM package files to PackageCloud using the Ruby gem package_cloud.
238 :Required parameters:
240 :build-dir: Directory with deb/rpm files to push
241 :debian-distribution-versions: list of DEB package distro/version strings
242 separated by space; example: ubuntu/bionic debian/stretch
243 :packagecloud-account: PackageCloud account ID; example: oran
244 :packagecloud-repo: PackageCloud repository; example: master, staging
245 :rpm-distribution-versions: list of RPM package distro/version strings
246 separated by space; example: el/4 el/5
251 Call pip install to install packages into a virtualenv located in
254 .. note:: Uses the first package listed in PIP_PACKAGES as the VENV name.
256 .. _lf-provide-maven-settings:
258 lf-provide-maven-settings
259 -------------------------
261 Push a global settings and user settings maven files to the build node.
263 lf-provide-maven-settings-cleanup
264 ---------------------------------
266 Cleanup maven ``settings.xml`` configuration. Set at the end of any macros that
268 :ref:`lf-provide-maven-settings <lf-provide-maven-settings>` macro.
273 Script to trigger a build on http://readthedocs.org
278 ReadTheDocs verify script. Installs and runs tox.
280 :Required parameters:
282 :doc-dir: Document directory.
283 :python-version: Python version.
288 Read the docs scripts that leverage the new Read the Docs v3 api
289 `RTD v3 API <https://docs.readthedocs.io/en/stable/api/v3.html>`_
290 Runs tox to verify that the docs are good and then runs the RTDv3 shell script.
291 This script handles creating projects as needed, assiging subprojects to the main
292 read the docs project and triggering builds to update the documentation.
293 Jobs will run but skip verify bits until a ``.readthedocs.yaml`` exists in the
294 root of their repository.
300 Validates votes on a changes to ``INFO.yaml``.
305 releases lftools.ini (required)
306 needed to push to nexus.
312 Then runs ../shell/release-job.sh
318 Use Sigul to sign a directory via {sign-dir}.
320 Requires ``SIGUL_BRIDGE_IP`` configured as a global envvar.
322 :Required Parameters:
323 :sign-artifacts: Set ``true`` to sign artifacts with Sigul.
324 :sign-dir: Directory to sign.
325 :sign-mode: serial|parallel
327 lf-infra-provide-docker-cleanup
328 -------------------------------
330 Forcefully removes all docker images.
335 Runs Jenkins SonarQube plug-in.
337 Requires ``SonarQube Scanner for Jenkins``
341 Optionally, set Sonar properties directly in the job definition by
342 setting the sonar-project-file to ``""`` and adding all properties under
343 ``sonar-properties``.
345 :Optional Parameters:
346 :sonar-task: Sonar task to run. (default: "")
347 :sonar-project-file: The filename for the project's properties
348 (default: "sonar-project.properties")
349 :sonar-properties: Sonar configuration properties. (default: "")
350 :sonar-java-opts: JVM options. (default: "")
351 :sonar-additional-args: Additional command line arguments. (default: "")
353 lf-infra-sonar-with-prescan
354 ---------------------------
356 Runs Jenkins SonarQube plug-in after a pre-scan builder.
358 Requires ``SonarQube Scanner for Jenkins``
362 Optionally, set Sonar properties directly in the job definition by
363 setting the sonar-project-file to ``""`` and adding all properties under
364 ``sonar-properties``.
366 :Required Parameters:
367 :lf-sonar-prescan: A builder that will run before the Sonar scan.
369 :Optional Parameters:
370 :sonar-task: Sonar task to run. (default: "")
371 :sonar-project-file: The filename for the project's properties
372 (default: "sonar-project.properties")
373 :sonar-properties: Sonar configuration properties. (default: "")
374 :sonar-java-opts: JVM options. (default: "")
375 :sonar-additional-args: Additional command line arguments. (default: "")
377 lf-infra-pipeline-verify
378 ------------------------
380 Verify a Jenkins pipeline by linting it and ensuring that it cannot run on the
386 lf-autotools-parameters
387 -----------------------
389 Provides parameters needed by configure and make. Use in any jobs that need to
390 call the ``configure && make`` pattern.
395 Provides the policy evaluation stage to run against Nexus IQ Server.
396 Valid values include: 'build', 'stage-release', 'operate'.
401 Provides parameters required by CMake. Use in any jobs that need to call the
402 ``cmake && make && make install`` pattern.
404 lf-infra-maven-parameters
405 -------------------------
407 Provides parameters required by Maven. Use in any jobs that need to call the
410 lf-infra-openstack-parameters
411 -----------------------------
413 Provides parameters needed by OpenStack client CLI. Use in jobs that need to
414 call the openstack cli.
416 :Required Parameters:
418 :os-cloud: Configures ``OS_CLOUD`` envvar as used by openstack cli.
423 Standard parameters used in the LF CI environments. GitHub projects will ignore
424 the Gerrit variables and vice-versa, so defining them is not harmful. Use in
427 lf-infra-node-parameters
428 ------------------------
430 Provides parameters needed by NodeJS and NPM. Use in any jobs that need to run
433 lf-infra-tox-parameters
434 -----------------------
436 Provides parameters required by python-tox. Use in any jobs that need to run
437 `tox <https://tox.readthedocs.io>`.
440 lf-build-with-parameters-maven-release
441 --------------------------------------
443 Provides parameters needed for maven release jobs 'build with parameters'.
451 Configures the build-discarder plugin for Jenkins with the recommended lf-infra
452 settings. We recommend to include in all job-templates.
460 Provides basic configuration for the JaCoCo plugin.
465 Provides basic lf-infra recommended publisher configurations for use in all job
466 templates. The purpose of this trigger is to gather package listing, instance
467 metadata, sar reports, build logs and copy them to a log server.
469 lf-infra-publish-windows
470 ------------------------
472 Windows publisher for use at the end of Windows job templates. Takes care of
473 cleaning out the workspace at the end of a job.
481 Basic SCM configuration for Gerrit based projects.
483 :Required parameters:
485 :submodule-timeout: Timeout (in minutes) for checkout operation.
487 :submodule-disable: Disable submodule checkout operation.
493 Basic SCM configuration for GitHub based projects.
495 On the `branch` variable you can assign ``$sha1`` or ``$ghprbActualCommit``
496 as the value. This will enable the jobs to trigger via the GHPRB plugin.
498 :Required parameters:
500 :submodule-timeout: Timeout (in minutes) for checkout operation.
502 :submodule-disable: Disable submodule checkout operation.
508 lf-infra-wrappers-common
509 ------------------------
511 Provides lf-infra recommended wrappers for use in every job-template. Include
512 this wrapper when creating more specific platform wrappers to ensure they pick
513 up the common settings.
518 Provides lf-infra recommended wrappers for use in every job-template targetting
521 This wrapper requires a managed file named ``npmrc`` to exist in Jenkins. The
522 main use case here is to point to a npm proxy, on Nexus for example. Set the
523 file type to "Custom file". You can set any npmrc settings in it,
524 documentation on npm configuration is available at
525 <https://docs.npmjs.com/files/npmrc>. If you are not using npm then create an
532 registry=https://nexus3.onap.org/repository/npm.public/
534 lf-infra-wrappers-windows
535 -------------------------
537 Provides lf-infra recommended wrappers for use in every job-template targetting
541 global-jjb-email-notification
542 -----------------------------
544 Provides a publisher macro that ties into the lf-openstack-cron job
545 to alert admins if this job fails.