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
85 condition-kind: boolean-expression
86 condition-expression: '{openstack}'
88 - config-file-provider:
90 - file-id: clouds-yaml
91 target: '$HOME/.config/openstack/clouds.yaml'
93 properties-content: OS_CLOUD={openstack-cloud}
94 - config-file-provider:
96 - file-id: '{packer-cloud-settings}'
100 PACKER_PLATFORM={platform}
101 PACKER_TEMPLATE={template}
102 PACKER_VERSION={packer-version}
103 - shell: !include-raw-escape:
104 - ../shell/packer-install.sh
105 - ../shell/packer-build.sh
106 - shell: !include-raw:
107 - ../shell/packer-clear-credentials.sh
110 name: lf-infra-packer-validate
113 condition-kind: boolean-expression
114 condition-expression: '{openstack}'
116 - config-file-provider:
118 - file-id: clouds-yaml
119 target: '$HOME/.config/openstack/clouds.yaml'
121 properties-content: OS_CLOUD={openstack-cloud}
122 - config-file-provider:
124 - file-id: '{packer-cloud-settings}'
127 properties-content: |
128 PACKER_VERSION={packer-version}
129 - shell: !include-raw-escape:
130 - ../shell/packer-install.sh
131 - ../shell/packer-validate.sh
132 - shell: !include-raw:
133 - ../shell/packer-clear-credentials.sh
136 name: lf-infra-push-gerrit-patch
139 properties-content: |
141 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
142 GERRIT_HOST={gerrit-host}
143 GERRIT_TOPIC={gerrit-topic}
144 GERRIT_USER={gerrit-user}
145 REVIEWERS_EMAIL={reviewers-email}
146 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
149 name: lf-infra-sysstat
151 - shell: !include-raw:
152 - ../shell/sysstat.sh
155 name: lf-jacoco-nojava-workaround
157 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
160 name: lf-infra-deploy-maven-file
163 mvn-version: '{mvn-version}'
164 - lf-provide-maven-settings:
165 global-settings-file: '{global-settings-file}'
166 settings-file: '{settings-file}'
168 properties-content: |
169 MAVEN_REPO_URL={maven-repo-url}
172 UPLOAD_FILES_PATH={upload-files-dir}
173 - shell: !include-raw-escape:
174 - ../shell/lftools-install.sh
175 - ../shell/common-variables.sh
176 - ../shell/deploy-maven-file.sh
177 - lf-provide-maven-settings-cleanup
180 name: lf-maven-install
182 # Create a $HOME/.wgetrc to make the Maven download quiet.
183 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
185 maven-version: '{mvn-version}'
187 - shell: 'rm "$HOME/.wgetrc"'
190 name: lf-provide-maven-settings
192 - config-file-provider:
194 - file-id: '{global-settings-file}'
195 variable: 'GLOBAL_SETTINGS_FILE'
196 - file-id: '{settings-file}'
197 variable: 'SETTINGS_FILE'
203 properties-content: PIP_PACKAGES={pip-packages}
204 - shell: !include-raw-escape: ../shell/pip-install.sh
207 name: lf-provide-maven-settings-cleanup
211 set +e # DO NOT cause build failure if any of the rm calls fail.
213 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
215 # In some cases we use the lf-provide-maven-settings macro to produce
216 # a "$HOME/.netrc" file containing credentials. Remove that file here
220 # DO NOT fail build if any of the above lines fail.
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: ../shell/tox-install.sh
238 - shell: !include-raw-escape: ../shell/rtd-verify.sh
241 name: lf-sigul-sign-dir
242 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
243 # Environment variable
246 condition-kind: boolean-expression
247 condition-expression: '{sign-artifacts}'
249 - config-file-provider:
251 - file-id: sigul-config
252 variable: SIGUL_CONFIG
253 - file-id: sigul-password
254 variable: SIGUL_PASSWORD
257 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
258 - shell: !include-raw-escape: ../shell/sigul-install.sh
260 properties-content: SIGN_DIR={sign-dir}
261 - shell: !include-raw-escape:
262 - ../shell/common-variables.sh
263 - ../shell/sigul-sign-dir.sh
264 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
267 name: lf-infra-provide-docker-cleanup
271 set +e # DO NOT cause build failure if docker rmi fails
272 docker rmi -f $(docker images -a -q)
281 name: lf-clm-parameters
285 default: '{nexus-iq-stage}'
287 Stage the policy evaluation will be run against on the Nexus IQ Server.
290 name: lf-cmake-parameters
291 # Parameters useful in CMake builds.
295 default: '{build-dir}'
296 description: 'Directory to build the project in.'
299 default: '{cmake-opts}'
301 Options to pass to CMAKE.
302 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
305 default: '{install-prefix}'
306 description: 'Install prefix for C/C++ builds. Example: /usr/local'
309 default: '{make-opts}'
310 description: 'Options to pass to make. Example: -j8'
313 name: lf-infra-maven-parameters
317 # Sets an env var for shell scripts to be able to call the dynamically
318 # installed maven without having to calculate the M2_HOME themselves.
319 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
320 description: 'Maven selector to be used by shell scripts'
323 default: '{mvn-opts}'
325 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
328 default: '{mvn-params}'
330 Maven parameters to pass to the mvn command.
333 # Sets an env var for shell scripts to be able to call the dynamically
334 # installed maven without having to calculate the path themselves.
335 # yamllint disable-line rule:line-length
336 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
337 description: 'Maven selector to be used by shell scripts'
340 name: lf-infra-openstack-parameters
344 default: '{os-cloud}'
346 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
347 variable name that is significant to openstack client as a
348 environment variable. Please refer to the documentation for
350 https://docs.openstack.org/developer/python-openstackclient/
354 name: lf-infra-parameters
355 # Standard parameters used in the LF CI environments. Gerrit variables are
356 # not used by GitHub projects, but defining them isn't harmful.
362 Parameter to identify a SCM project to build. This is typically
363 the project repo path. For example: ofextensions/circuitsw
368 Stream is often set to the same name as 'branch' but can
369 sometimes be used as a name representing a project's release code
375 Gerrit Trigger provided parameter to identify Gerrit project that
376 triggered the build. This is typically the project repo path as
377 exists in Gerrit. For example: ofextensions/circuitsw
379 If using Gerrit, in a manual build this should match the PROJECT
385 Gerrit Trigger provided parameter to identify a Gerrit branch.
387 If using Gerrit, in a manual build override with the branch to
391 default: 'refs/heads/{branch}'
393 Gerrit Trigger provided parameter to identify a refspec to fetch
396 If using Gerrit, in a manual build override with a refspec.
397 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
398 For example: 'refs/heads/master'
401 default: 'origin/{branch}'
403 GitHub PR Trigger provided parameter for specifying the commit
406 If using GitHub, in a manual build override with a branch path or
407 sha1 hash to a specific commit. For example: 'origin/master'
410 name: LFTOOLS_VERSION
411 default: '{lftools-version}'
413 Version of lftools to install. Can be a specific version like
414 '0.6.0' or a PEP-440 definition.
415 https://www.python.org/dev/peps/pep-0440/
416 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
419 name: lf-infra-node-parameters
423 default: '{node-dir}'
424 description: Path to a Node project directory.
427 default: '{node-version}'
428 description: Version of NodeJS to install.
431 name: lf-infra-tox-parameters
437 Path to directory containing tox.ini file.
440 default: '{tox-envs}'
442 Tox environments to run build against.
443 Example: docs,py2,py3
450 name: lf-infra-properties
453 # Allow build data to be stored at a length configured by the
454 # downstream project.
455 days-to-keep: '{build-days-to-keep}'
456 # Do not allow artifacts to be stored in Jenkins.
457 artifact-num-to-keep: 0
464 name: lf-jacoco-report
467 exec-pattern: "**/**.exec"
468 class-pattern: "**/classes"
469 source-pattern: "**/src/main/java"
470 # yamllint disable-line rule:line-length
471 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
482 name: lf-infra-publish
483 # lf-infra macro to finish up a build.
485 # Handles the following:
486 # - Shipping logs to Nexus logs site repository
487 # - Cleanup workspace
500 - lf-infra-package-listing
502 mark-unstable-if-failed: true
505 # Do not clean up *.jenkins-trigger files for jobs that use a
506 # properties file as input for triggering another build.
507 - '**/*.jenkins-trigger'
511 name: lf-infra-publish-windows
512 # lf-infra macro to finish up a build.
514 # Handles the following:
515 # - Shipping logs to Nexus logs site repository
516 # - Cleanup workspace
518 # TODO: RELENG-1228 Develop log shipping script for Windows systems
529 # - lf-infra-ship-logs-windows
530 # mark-unstable-if-failed: true
533 # Do not clean up *.jenkins-trigger files for jobs that use a
534 # properties file as input for triggering another build.
535 - '**/*.jenkins-trigger'
539 name: lf-stack-delete
552 echo "Deleting $STACK_NAME"
553 lftools openstack stack delete "$STACK_NAME"
554 mark-unstable-if-failed: false
561 name: lf-infra-gerrit-scm
564 credentials-id: '{jenkins-ssh-credential}'
568 - 'refs/heads/{branch}'
572 recursive: '{submodule-recursive}'
573 timeout: '{submodule-timeout}'
574 choosing-strategy: '{choosing-strategy}'
577 name: lf-infra-github-scm
580 credentials-id: '{jenkins-ssh-credential}'
588 recursive: '{submodule-recursive}'
589 timeout: '{submodule-timeout}'
590 choosing-strategy: '{choosing-strategy}'
597 name: lf-infra-wrappers-common
602 timeout: '{build-timeout}'
603 timeout-var: 'BUILD_TIMEOUT'
610 name: lf-infra-wrappers
612 - lf-infra-wrappers-common:
613 build-timeout: '{build-timeout}'
614 - config-file-provider:
617 target: '$HOME/.npmrc'
619 target: '$HOME/.config/pip/pip.conf'
620 - ssh-agent-credentials:
622 - '{jenkins-ssh-credential}'
625 name: lf-infra-wrappers-windows
627 - lf-infra-wrappers-common:
628 build-timeout: '{build-timeout}'