7 name: lf-fetch-dependent-patches
9 - shell: !include-raw: ../shell/gerrit-fetch-dependencies.sh
11 properties-file: $WORKSPACE/.dependency.properties
14 name: lf-license-check
18 FILE_PATTERNS={file-patterns}
19 SPDX_DISABLE={spdx-disable}
20 LHC_VERSION={lhc-version}
21 LICENSE_EXCLUDE_PATHS={license-exclude-paths}
22 LICENSES_ALLOWED={licenses-allowed}
23 - shell: !include-raw-escape:
24 - ../shell/license-check.sh
27 name: lf-infra-create-netrc
30 properties-content: 'SERVER_ID={server-id}'
31 - shell: !include-raw-escape: ../shell/create-netrc.sh
34 name: lf-infra-docker-login
36 - lf-provide-maven-settings:
37 global-settings-file: '{global-settings-file}'
38 settings-file: '{settings-file}'
39 - shell: !include-raw-escape: ../shell/docker-login.sh
40 - lf-provide-maven-settings-cleanup
43 name: lf-infra-gpg-verify-git-signature
44 # TODO: Verify signature after downloading users public key from a locally
45 # created repository instead of the public keymesh. This requires a process
46 # in place to get ODL developers public keys into a local repository without
47 # increasing the job thoughput.
49 - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
52 name: lf-infra-pre-build
54 - shell: !include-raw-escape: ../shell/python-tools-install.sh
57 name: lf-infra-ship-logs
59 - config-file-provider:
61 - file-id: 'jenkins-log-archives-settings'
62 variable: 'SETTINGS_FILE'
63 - lf-infra-create-netrc:
65 - shell: !include-raw:
66 # Ensure python-tools are installed in case job template does not
67 # call the lf-infra-pre-build macro.
68 - ../shell/python-tools-install.sh
69 - ../shell/logs-deploy.sh
70 - shell: !include-raw:
71 - ../shell/logs-clear-credentials.sh
73 regexp: '^Build logs: .*'
76 name: lf-infra-package-listing
78 - shell: !include-raw:
79 - ../shell/package-listing.sh
82 name: lf-infra-packer-build
84 - config-file-provider:
86 - file-id: '{packer-cloud-settings}'
90 PACKER_PLATFORM={platform}
91 PACKER_TEMPLATE={template}
92 PACKER_VERSION={packer-version}
93 - shell: !include-raw-escape:
94 - ../shell/packer-install.sh
95 - ../shell/packer-build.sh
96 - shell: !include-raw:
97 - ../shell/packer-clear-credentials.sh
100 name: lf-infra-packer-validate
102 - config-file-provider:
104 - file-id: '{packer-cloud-settings}'
107 properties-content: |
108 PACKER_VERSION={packer-version}
109 - shell: !include-raw-escape:
110 - ../shell/packer-install.sh
111 - ../shell/packer-validate.sh
112 - shell: !include-raw:
113 - ../shell/packer-clear-credentials.sh
116 name: lf-infra-push-gerrit-patch
119 properties-content: |
121 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
122 GERRIT_HOST={gerrit-host}
123 GERRIT_TOPIC={gerrit-topic}
124 GERRIT_USER={gerrit-user}
125 REVIEWERS_EMAIL={reviewers-email}
126 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
129 name: lf-infra-sysstat
131 - shell: !include-raw:
132 - ../shell/sysstat.sh
135 name: lf-jacoco-nojava-workaround
137 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
140 name: lf-infra-deploy-maven-file
143 mvn-version: '{mvn-version}'
144 - lf-provide-maven-settings:
145 global-settings-file: '{global-settings-file}'
146 settings-file: '{settings-file}'
148 properties-content: |
149 MAVEN_REPO_URL={maven-repo-url}
152 UPLOAD_FILES_PATH={upload-files-dir}
153 - shell: !include-raw-escape:
154 - ../shell/lftools-install.sh
155 - ../shell/common-variables.sh
156 - ../shell/deploy-maven-file.sh
157 - lf-provide-maven-settings-cleanup
160 name: lf-maven-install
162 # Create a $HOME/.wgetrc to make the Maven download quiet.
163 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
165 maven-version: '{mvn-version}'
167 - shell: 'rm "$HOME/.wgetrc"'
170 name: lf-provide-maven-settings
172 - config-file-provider:
174 - file-id: '{global-settings-file}'
175 variable: 'GLOBAL_SETTINGS_FILE'
176 - file-id: '{settings-file}'
177 variable: 'SETTINGS_FILE'
180 name: lf-provide-sigul-configuration
181 # Push configuration files to interact with sigul
183 - config-file-provider:
185 - file-id: sigul-config
186 variable: SIGUL_CONFIG
187 - file-id: sigul-password
188 variable: SIGUL_PASSWORD
191 - shell: !include-raw: ../shell/sigul-configuration.sh
197 properties-content: PIP_PACKAGES={pip-packages}
198 - shell: !include-raw-escape: ../shell/pip-install.sh
201 name: lf-provide-maven-settings-cleanup
205 set +e # DO NOT cause build failure if any of the rm calls fail.
207 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
209 # In some cases we use the lf-provide-maven-settings macro to produce
210 # a "$HOME/.netrc" file containing credentials. Remove that file here
214 # DO NOT fail build if any of the above lines fail.
218 name: lf-provide-sigul-configuration-cleanup
219 # Clear sigul configuration files after we're done using them
221 - shell: !include-raw: ../shell/sigul-configuration-cleanup.sh
224 name: lf-rtd-trigger-build
227 properties-content: |
228 RTD_BUILD_URL={rtd-build-url}
229 RTD_TOKEN={rtd-token}
230 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
236 properties-content: DOC_DIR={doc-dir}
237 - shell: !include-raw-escape:
238 - ../shell/tox-install.sh
239 - ../shell/rtd-verify.sh
242 name: lf-sigul-install
243 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
244 # Environment variable
246 - shell: !include-raw: ../shell/sigul-install.sh
249 name: lf-infra-provide-docker-cleanup
253 set +e # DO NOT cause build failure if docker rmi fails
254 docker rmi -f $(docker images -a -q)
263 name: lf-clm-parameters
267 default: '{nexus-iq-stage}'
269 Stage the policy evaluation will be run against on the Nexus IQ Server.
272 name: lf-cmake-parameters
273 # Parameters useful in CMake builds.
277 default: '{build-dir}'
278 description: 'Directory to build the project in.'
281 default: '{cmake-opts}'
283 Options to pass to CMAKE.
284 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
287 default: '{install-prefix}'
288 description: 'Install prefix for C/C++ builds. Example: /usr/local'
291 default: '{make-opts}'
292 description: 'Options to pass to make. Example: -j8'
295 name: lf-infra-maven-parameters
299 # Sets an env var for shell scripts to be able to call the dynamically
300 # installed maven without having to calculate the M2_HOME themselves.
301 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
302 description: 'Maven selector to be used by shell scripts'
305 default: '{mvn-opts}'
307 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
310 default: '{mvn-params}'
312 Maven parameters to pass to the mvn command.
315 # Sets an env var for shell scripts to be able to call the dynamically
316 # installed maven without having to calculate the path themselves.
317 # yamllint disable-line rule:line-length
318 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
319 description: 'Maven selector to be used by shell scripts'
322 name: lf-infra-openstack-parameters
326 default: '{os-cloud}'
328 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
329 variable name that is significant to openstack client as a
330 environment variable. Please refer to the documentation for
332 https://docs.openstack.org/developer/python-openstackclient/
336 name: lf-infra-parameters
337 # Standard parameters used in the LF CI environments. Gerrit variables are
338 # not used by GitHub projects, but defining them isn't harmful.
344 Parameter to identify a SCM project to build. This is typically
345 the project repo path. For example: ofextensions/circuitsw
350 Stream is often set to the same name as 'branch' but can
351 sometimes be used as a name representing a project's release code
357 Gerrit Trigger provided parameter to identify Gerrit project that
358 triggered the build. This is typically the project repo path as
359 exists in Gerrit. For example: ofextensions/circuitsw
361 If using Gerrit, in a manual build this should match the PROJECT
367 Gerrit Trigger provided parameter to identify a Gerrit branch.
369 If using Gerrit, in a manual build override with the branch to
373 default: 'refs/heads/{branch}'
375 Gerrit Trigger provided parameter to identify a refspec to fetch
378 If using Gerrit, in a manual build override with a refspec.
379 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
380 For example: 'refs/heads/master'
383 default: 'origin/{branch}'
385 GitHub PR Trigger provided parameter for specifying the commit
388 If using GitHub, in a manual build override with a branch path or
389 sha1 hash to a specific commit. For example: 'origin/master'
392 name: LFTOOLS_VERSION
393 default: '{lftools-version}'
395 Version of lftools to install. Can be a specific version like
396 '0.6.0' or a PEP-440 definition.
397 https://www.python.org/dev/peps/pep-0440/
398 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
401 name: lf-infra-node-parameters
405 default: '{node-dir}'
406 description: Path to a Node project directory.
409 default: '{node-version}'
410 description: Version of NodeJS to install.
413 name: lf-infra-tox-parameters
419 Path to directory containing tox.ini file.
422 default: '{tox-envs}'
424 Tox environments to run build against.
425 Example: docs,py2,py3
432 name: lf-infra-properties
435 # Allow build data to be stored at a length configured by the
436 # downstream project.
437 days-to-keep: '{build-days-to-keep}'
438 # Do not allow artifacts to be stored in Jenkins.
439 artifact-num-to-keep: 0
446 name: lf-jacoco-report
449 exec-pattern: "**/**.exec"
450 class-pattern: "**/classes"
451 source-pattern: "**/src/main/java"
452 # yamllint disable-line rule:line-length
453 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
464 name: lf-infra-publish
465 # lf-infra macro to finish up a build.
467 # Handles the following:
468 # - Shipping logs to Nexus logs site repository
469 # - Cleanup workspace
482 - lf-infra-package-listing
484 mark-unstable-if-failed: true
487 # Do not clean up *.jenkins-trigger files for jobs that use a
488 # properties file as input for triggering another build.
489 - '**/*.jenkins-trigger'
497 name: lf-infra-gerrit-scm
500 credentials-id: '{jenkins-ssh-credential}'
504 - 'refs/heads/{branch}'
508 recursive: '{submodule-recursive}'
509 choosing-strategy: '{choosing-strategy}'
512 name: lf-infra-github-scm
515 credentials-id: '{jenkins-ssh-credential}'
523 recursive: '{submodule-recursive}'
524 choosing-strategy: '{choosing-strategy}'
531 name: lf-infra-wrappers
536 timeout: '{build-timeout}'
537 timeout-var: 'BUILD_TIMEOUT'
540 - ssh-agent-credentials:
542 - '{jenkins-ssh-credential}'
545 - config-file-provider:
548 target: '$HOME/.npmrc'
550 target: '$HOME/.config/pip/pip.conf'