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.
130 :packer-builder: builder type to use. ex: aws, openstack (default: openstack)
132 :Optional parameters:
134 :update-cloud-image: Submit a change request to update new built cloud
137 lf-infra-packer-validate
138 ------------------------
140 Run ``packer validate`` to verify packer configuration.
142 :Required parameters:
144 :openstack: Packer template uses an OpenStack builder (true|false).
145 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
146 :packer-cloud-settings: Cloud configuration file. Loaded on the build
147 server as CLOUDENV environment variable.
148 :packer-version: Version of packer to use.
149 :packer-builder: builder type to use. ex: aws, openstack (default: openstack)
151 lf-infra-push-gerrit-patch
152 --------------------------
154 Push a change through a Jenkins job to a Gerrit repository in an automated
155 way using git-review.
157 :Required parameters:
159 :gerrit-commit-message: Commit message to assign.
160 :gerrit-host: Gerrit hostname.
161 :gerrit-topic: Gerrit topic.
162 :gerrit-user: Gerrit user-id used for submitting the change.
163 :reviewers-email: Reviewers email. Space-separated list of
164 email addresses to CC on the patch.
165 :project: Gerrit project name.
167 .. _lf-infra-ship-logs:
172 Gather and deploy logs to a log server.
177 Retrieves system stats.
179 lf-infra-update-packer-images
180 -----------------------------
182 Find and update the new built cloud image{s} in the ci-management source
186 lf-jacoco-nojava-workaround
187 ---------------------------
189 Workaround for Jenkins not able to find Java in JaCoCo runs.
191 .. _lf-maven-central:
196 Publish artifacts to OSSRH (Maven Central) staging.
198 Requires that the project's settings.xml contains a ServerId 'ossrh' with the
199 credentials for the project's OSSRH account.
201 This macro assumes the directory ``$WORKSPACE/m2repo`` contains a Maven 2
202 repository which is to upload to OSSRH.
204 :Required parameters:
206 :mvn-central: Set to ``true`` to upload to mvn-central. (true|false)
207 :mvn-global-settings: The name of the Maven global settings to use for
208 Maven configuration. (default: global-settings)
209 :mvn-settings: The name of settings file containing credentials for the
211 :ossrh-profile-id: Nexus staging profile ID as provided by OSSRH.
213 .. literalinclude:: ../../.jjb-test/lf-macros/lf-maven-central-minimal.yaml
216 .. _lf-maven-install:
221 Call maven-target builder with a goal of ``--version`` to force Jenkins to
222 install the declared version of Maven. Use this as a preparation step for
223 any shell scripts that want to use Maven.
225 :Required parameters:
227 :mvn-version: Version of Maven to install.
229 lf-packagecloud-file-provider
230 -----------------------------
232 Provisions files required by the Ruby gem package_cloud, namely
233 ".packagecloud" and "packagecloud_api" in the Jenkins home directory.
238 Pushes DEB/RPM package files to PackageCloud using the Ruby gem package_cloud.
240 :Required parameters:
242 :build-dir: Directory with deb/rpm files to push
243 :debian-distribution-versions: list of DEB package distro/version strings
244 separated by space; example: ubuntu/bionic debian/stretch
245 :packagecloud-account: PackageCloud account ID; example: oran
246 :packagecloud-repo: PackageCloud repository; example: master, staging
247 :rpm-distribution-versions: list of RPM package distro/version strings
248 separated by space; example: el/4 el/5
253 Call pip install to install packages into a virtualenv located in
256 .. note:: Uses the first package listed in PIP_PACKAGES as the VENV name.
258 .. _lf-provide-maven-settings:
260 lf-provide-maven-settings
261 -------------------------
263 Push a global settings and user settings maven files to the build node.
265 lf-provide-maven-settings-cleanup
266 ---------------------------------
268 Cleanup maven ``settings.xml`` configuration. Set at the end of any macros that
270 :ref:`lf-provide-maven-settings <lf-provide-maven-settings>` macro.
275 Script to trigger a build on http://readthedocs.org
280 ReadTheDocs verify script. Installs and runs tox.
282 :Required parameters:
284 :doc-dir: Document directory.
285 :python-version: Python version.
290 Read the docs scripts that leverage the new Read the Docs v3 api
291 `RTD v3 API <https://docs.readthedocs.io/en/stable/api/v3.html>`_
292 Runs tox to verify that the docs are good and then runs the RTDv3 shell script.
293 This script handles creating projects as needed, assiging subprojects to the main
294 read the docs project and triggering builds to update the documentation.
295 Jobs will run but skip verify bits until a ``.readthedocs.yaml`` exists in the
296 root of their repository.
302 Validates votes on a changes to ``INFO.yaml``.
307 releases lftools.ini (required)
308 needed to push to nexus.
314 Then runs ../shell/release-job.sh
320 Use Sigul to sign a directory via {sign-dir}.
322 Requires ``SIGUL_BRIDGE_IP`` configured as a global envvar.
324 :Required Parameters:
325 :sign-artifacts: Set ``true`` to sign artifacts with Sigul.
326 :sign-dir: Directory to sign.
327 :sign-mode: serial|parallel
329 lf-infra-provide-docker-cleanup
330 -------------------------------
332 Forcefully removes all docker images.
337 Runs Jenkins SonarQube plug-in.
339 Requires ``SonarQube Scanner for Jenkins``
343 Optionally, set Sonar properties directly in the job definition by
344 setting the sonar-project-file to ``""`` and adding all properties under
345 ``sonar-properties``.
347 :Optional Parameters:
348 :sonar-task: Sonar task to run. (default: "")
349 :sonar-project-file: The filename for the project's properties
350 (default: "sonar-project.properties")
351 :sonar-properties: Sonar configuration properties. (default: "")
352 :sonar-java-opts: JVM options. (default: "")
353 :sonar-additional-args: Additional command line arguments. (default: "")
355 lf-infra-sonar-with-prescan
356 ---------------------------
358 Runs Jenkins SonarQube plug-in after a pre-scan builder.
360 Requires ``SonarQube Scanner for Jenkins``
364 Optionally, set Sonar properties directly in the job definition by
365 setting the sonar-project-file to ``""`` and adding all properties under
366 ``sonar-properties``.
368 :Required Parameters:
369 :lf-sonar-prescan: A builder that will run before the Sonar scan.
371 :Optional Parameters:
372 :sonar-task: Sonar task to run. (default: "")
373 :sonar-project-file: The filename for the project's properties
374 (default: "sonar-project.properties")
375 :sonar-properties: Sonar configuration properties. (default: "")
376 :sonar-java-opts: JVM options. (default: "")
377 :sonar-additional-args: Additional command line arguments. (default: "")
379 lf-infra-pipeline-verify
380 ------------------------
382 Verify a Jenkins pipeline by linting it and ensuring that it cannot run on the
388 lf-autotools-parameters
389 -----------------------
391 Provides parameters needed by configure and make. Use in any jobs that need to
392 call the ``configure && make`` pattern.
397 Provides the policy evaluation stage to run against Nexus IQ Server.
398 Valid values include: 'build', 'stage-release', 'operate'.
403 Provides parameters required by CMake. Use in any jobs that need to call the
404 ``cmake && make && make install`` pattern.
406 lf-infra-maven-parameters
407 -------------------------
409 Provides parameters required by Maven. Use in any jobs that need to call the
412 lf-infra-openstack-parameters
413 -----------------------------
415 Provides parameters needed by OpenStack client CLI. Use in jobs that need to
416 call the openstack cli.
418 :Required Parameters:
420 :os-cloud: Configures ``OS_CLOUD`` envvar as used by openstack cli.
425 Standard parameters used in the LF CI environments. GitHub projects will ignore
426 the Gerrit variables and vice-versa, so defining them is not harmful. Use in
429 lf-infra-node-parameters
430 ------------------------
432 Provides parameters needed by NodeJS and NPM. Use in any jobs that need to run
435 lf-infra-tox-parameters
436 -----------------------
438 Provides parameters required by python-tox. Use in any jobs that need to run
439 `tox <https://tox.readthedocs.io>`.
442 lf-build-with-parameters-maven-release
443 --------------------------------------
445 Provides parameters needed for maven release jobs 'build with parameters'.
453 Configures the build-discarder plugin for Jenkins with the recommended lf-infra
454 settings. We recommend to include in all job-templates.
462 Provides basic configuration for the JaCoCo plugin.
467 Provides basic lf-infra recommended publisher configurations for use in all job
468 templates. The purpose of this trigger is to gather package listing, instance
469 metadata, sar reports, build logs and copy them to a log server.
471 lf-infra-publish-windows
472 ------------------------
474 Windows publisher for use at the end of Windows job templates. Takes care of
475 cleaning out the workspace at the end of a job.
483 Basic SCM configuration for Gerrit based projects.
485 :Required parameters:
487 :submodule-timeout: Timeout (in minutes) for checkout operation.
489 :submodule-disable: Disable submodule checkout operation.
495 Basic SCM configuration for GitHub based projects.
497 On the `branch` variable you can assign ``$sha1`` or ``$ghprbActualCommit``
498 as the value. This will enable the jobs to trigger via the GHPRB plugin.
500 :Required parameters:
502 :submodule-timeout: Timeout (in minutes) for checkout operation.
504 :submodule-disable: Disable submodule checkout operation.
510 lf-infra-wrappers-common
511 ------------------------
513 Provides lf-infra recommended wrappers for use in every job-template. Include
514 this wrapper when creating more specific platform wrappers to ensure they pick
515 up the common settings.
520 Provides lf-infra recommended wrappers for use in every job-template targetting
523 This wrapper requires a managed file named ``npmrc`` to exist in Jenkins. The
524 main use case here is to point to a npm proxy, on Nexus for example. Set the
525 file type to "Custom file". You can set any npmrc settings in it,
526 documentation on npm configuration is available at
527 <https://docs.npmjs.com/files/npmrc>. If you are not using npm then create an
534 registry=https://nexus3.onap.org/repository/npm.public/
536 lf-infra-wrappers-windows
537 -------------------------
539 Provides lf-infra recommended wrappers for use in every job-template targetting
543 global-jjb-email-notification
544 -----------------------------
546 Provides a publisher macro that ties into the lf-openstack-cron job
547 to alert admins if this job fails.