7 name: lf-fetch-dependent-patches
8 # Fetches all patches provided via comment trigger
10 # This macro will fetch all patches provided via comment trigger and will
11 # create a list of projects from those patches via environment variable
12 # called DEPENDENCY_BUILD_ORDER which can be used if necessary to build
13 # projects in the specified order. The order is determined by first patch
14 # instance for a project in the patch list.
16 - shell: !include-raw: ../shell/gerrit-fetch-dependencies.sh
18 properties-file: $WORKSPACE/.dependency.properties
21 name: lf-infra-create-netrc
22 # Macro to create a ~/.netrc file from a Maven settings.xml
24 # {server-id} The id of a server as defined in settings.xml
27 properties-content: 'SERVER_ID={server-id}'
28 - shell: !include-raw-escape: ../shell/create-netrc.sh
31 name: lf-infra-docker-login
32 # Login into a custom hosted docker registry and / or docker.io
34 # The Jenkins system should have the following global variables defined
36 # DOCKER_REGISTRY : Optional
37 # The DNS address of the registry (IP or FQDN)
38 # ex: nexus3.example.com
40 # REGISTRY_PORTS : Required if DOCKER_REGISTRY is set
41 # Space separated listing of the registry ports to login
43 # ex: 10001 10002 10003 10004
45 # DOCKERHUB_EMAIL : Optional
46 # If this variable is set then an attempt to login to
47 # DockerHub (docker.io) will be also made. It should be
48 # set to the email address for the credentials that will
49 # get looked up. Only _one_ credential will ever be found
50 # in the maven settings file for DockerHub
52 - lf-provide-maven-settings:
53 global-settings-file: '{global-settings-file}'
54 settings-file: '{settings-file}'
55 - shell: !include-raw-escape: ../shell/docker-login.sh
56 - lf-provide-maven-settings-cleanup
59 name: lf-infra-gpg-verify-git-signature
60 # Verify gpg signature of the latest commit message in $WORKSPACE
62 # This command assumes that $WORKSPACE is a git repo.
64 # TODO: Verify signature after downloading users public key from a locally
65 # created repository instead of the public keymesh. This requires a process
66 # in place to get ODL developers public keys into a local repository without
67 # increasing the job thoughput.
69 - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
72 name: lf-infra-ship-logs
74 - config-file-provider:
76 - file-id: 'jenkins-log-archives-settings'
77 variable: 'SETTINGS_FILE'
78 - lf-infra-create-netrc:
80 - shell: !include-raw:
81 - ../shell/lftools-install.sh
82 - ../shell/logs-deploy.sh
83 - shell: !include-raw:
84 - ../shell/logs-clear-credentials.sh
86 regexp: '^Build logs: .*'
89 name: lf-infra-packer-build
91 - config-file-provider:
93 - file-id: '{packer-cloud-settings}'
97 PACKER_PLATFORM={platform}
98 PACKER_TEMPLATE={template}
99 PACKER_VERSION={packer-version}
100 - shell: !include-raw-escape:
101 - ../shell/packer-install.sh
102 - ../shell/packer-build.sh
103 - shell: !include-raw:
104 - ../shell/packer-clear-credentials.sh
107 name: lf-infra-packer-validate
109 - config-file-provider:
111 - file-id: '{packer-cloud-settings}'
114 properties-content: |
115 PACKER_VERSION={packer-version}
116 - shell: !include-raw-escape:
117 - ../shell/packer-install.sh
118 - ../shell/packer-validate.sh
119 - shell: !include-raw:
120 - ../shell/packer-clear-credentials.sh
123 name: lf-infra-sysstat
125 - shell: !include-raw:
126 - ../shell/sysstat.sh
129 name: lf-jacoco-nojava-workaround
131 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
134 name: lf-infra-deploy-maven-file
135 # Deploy files to a repository.
137 # The builder requires passing the following parameters
138 # REPO_ID: Repository ID
139 # GROUP_ID: Group ID of the repository
140 # UPLOAD_FILES_PATH: Path to directory containing one or more files
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
161 # call maven-target builder with a goal of --version to force Jenkins to
162 # install the needed maven version
164 # Create a $HOME/.wgetrc to make the Maven download quiet.
165 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
167 maven-version: '{mvn-version}'
169 - shell: 'rm "$HOME/.wgetrc"'
172 name: lf-provide-maven-settings
173 # Push a global settings and user settings maven files
175 - config-file-provider:
177 - file-id: '{global-settings-file}'
178 variable: 'GLOBAL_SETTINGS_FILE'
179 - file-id: '{settings-file}'
180 variable: 'SETTINGS_FILE'
184 # Call pip install to install packages into a virtualenv
185 # The first package listed in PIP_PACKAGES is used as the virtualenv name.
188 properties-content: PIP_PACKAGES={pip-packages}
189 - shell: !include-raw-escape: ../shell/pip-install.sh
192 name: lf-provide-maven-settings-cleanup
193 # Clear maven settings files after we are done using them
197 set +e # DO NOT cause build failure if any of the rm calls fail.
199 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
201 # In some cases we use the lf-provide-maven-settings macro to produce
202 # a "$HOME/.netrc" file containing credentials. Remove that file here
206 # DO NOT fail build if any of the above lines fail.
210 name: lf-rtd-trigger-build
213 properties-content: RTD_PROJECT={rtd-project}
214 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
220 properties-content: DOC_DIR={doc-dir}
221 - shell: !include-raw-escape:
222 - ../shell/tox-install.sh
223 - ../shell/rtd-verify.sh
230 name: lf-infra-maven-parameters
234 default: '{mvn-opts}'
236 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
239 default: '{mvn-params}'
241 Maven parameters to pass to the mvn command.
244 # Sets an env var for shell scripts to be able to call the dynamically
245 # installed maven without having to calculate the path themselves.
246 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
247 description: 'Maven selector to be used by shell scripts'
249 name: STAGING_PROFILE_ID
250 default: '{staging-profile-id}'
252 Nexus staging profile ID.
256 name: lf-infra-openstack-parameters
260 default: '{os-cloud}'
262 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
263 variable name that is significant to openstack client as a
264 environment variable. Please refer to the documentation for
266 https://docs.openstack.org/developer/python-openstackclient/
270 name: lf-infra-parameters
271 # Standard parameters used in the LF CI environments. Gerrit variables are
272 # not used by GitHub projects, but defining them isn't harmful.
278 Parameter to identify a Gerrit project. This is typically the
279 project repo path as exists in Gerrit.
280 For example: ofextensions/circuitsw
285 Stream is often set to the same name as 'branch' but can
286 sometimes be used as a name representing a project's release code
292 Parameter to identify Gerrit project. This is typically the
293 project repo path as exists in Gerrit.
294 For example: ofextensions/circuitsw
296 Note that Gerrit will override this parameter automatically if a
297 job is triggered by Gerrit.
302 Parameter to identify a Gerrit branch.
304 Note that Gerrit will override this parameter automatically if a
305 job is triggered by Gerrit.
308 default: 'refs/heads/{branch}'
310 Parameter to identify a refspec when pulling from Gerrit.
312 Note that Gerrit will override this parameter automatically if a
313 job is triggered by Gerrit.
315 name: LFTOOLS_VERSION
316 default: '{lftools-version}'
318 Version of lftools to install. Can be a specific version like
319 '0.6.0' or a PEP-440 definition.
320 https://www.python.org/dev/peps/pep-0440/
321 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
324 name: lf-infra-node-parameters
325 # Parameters for NodeJS
329 default: '{node-dir}'
330 description: Path to a Node project directory.
333 default: '{node-version}'
334 description: Version of NodeJS to install.
337 name: lf-infra-tox-parameters
338 # Useful parameters when working with TOX
339 # https://tox.readthedocs.io/
345 Path to directory containing tox.ini file.
348 default: '{tox-envs}'
350 Tox environments to run build against.
351 Example: docs,py2,py3
358 name: lf-infra-properties
361 # Allow build data to be stored at a length configured by the
362 # downstream project.
363 days-to-keep: '{build-days-to-keep}'
364 # Do not allow artifacts to be stored in Jenkins.
365 artifact-num-to-keep: 0
372 name: lf-jacoco-report
375 exec-pattern: "**/**.exec"
376 class-pattern: "**/classes"
377 source-pattern: "**/src/main/java"
378 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
389 name: lf-infra-publish
390 # lf-infra macro to finish up a build.
392 # Handles the following:
393 # - Shipping logs to Nexus logs site repository
394 # - Cleanup workspace
400 script-only-if-succeeded: false
401 script-only-if-failed: false
402 mark-unstable-if-failed: false
405 # Do not clean up *.jenkins-trigger files for jobs that use a
406 # properties file as input for triggering another build.
407 - '**/*.jenkins-trigger'
415 name: lf-infra-gerrit-scm
418 credentials-id: '{jenkins-ssh-credential}'
422 - 'refs/heads/{branch}'
426 recursive: '{submodule-recursive}'
427 choosing-strategy: '{choosing-strategy}'
430 name: lf-infra-github-scm
433 credentials-id: '{jenkins-ssh-credential}'
439 recursive: '{submodule-recursive}'
440 choosing-strategy: '{choosing-strategy}'
447 name: lf-infra-github-pr-trigger
449 - github-pull-request:
450 trigger-phrase: '{trigger-phrase}'
451 only-trigger-phrase: '{only-trigger-phrase}'
452 status-context: '{status-context}'
453 permit-all: '{permit-all}'
454 github-hooks: '{github-hooks}'
455 auto-close-on-fail: false
458 white-list: '{obj:github_pr_whitelist}'
459 admin-list: '{obj:github_pr_admin_list}'
466 name: lf-infra-wrappers
471 timeout: '{build-timeout}'
472 timeout-var: 'BUILD_TIMEOUT'
475 - ssh-agent-credentials:
477 - '{jenkins-ssh-credential}'