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 # Sets an env var for shell scripts to be able to call the dynamically
235 # installed maven without having to calculate the M2_HOME themselves.
236 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
237 description: 'Maven selector to be used by shell scripts'
240 default: '{mvn-opts}'
242 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
245 default: '{mvn-params}'
247 Maven parameters to pass to the mvn command.
250 # Sets an env var for shell scripts to be able to call the dynamically
251 # installed maven without having to calculate the path themselves.
252 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
253 description: 'Maven selector to be used by shell scripts'
255 name: STAGING_PROFILE_ID
256 default: '{staging-profile-id}'
258 Nexus staging profile ID.
262 name: lf-infra-openstack-parameters
266 default: '{os-cloud}'
268 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
269 variable name that is significant to openstack client as a
270 environment variable. Please refer to the documentation for
272 https://docs.openstack.org/developer/python-openstackclient/
276 name: lf-infra-parameters
277 # Standard parameters used in the LF CI environments. Gerrit variables are
278 # not used by GitHub projects, but defining them isn't harmful.
284 Parameter to identify a Gerrit project. This is typically the
285 project repo path as exists in Gerrit.
286 For example: ofextensions/circuitsw
291 Stream is often set to the same name as 'branch' but can
292 sometimes be used as a name representing a project's release code
298 Parameter to identify Gerrit project. This is typically the
299 project repo path as exists in Gerrit.
300 For example: ofextensions/circuitsw
302 Note that Gerrit will override this parameter automatically if a
303 job is triggered by Gerrit.
308 Parameter to identify a Gerrit branch.
310 Note that Gerrit will override this parameter automatically if a
311 job is triggered by Gerrit.
314 default: 'refs/heads/{branch}'
316 Parameter to identify a refspec when pulling from Gerrit.
318 Note that Gerrit will override this parameter automatically if a
319 job is triggered by Gerrit.
321 name: LFTOOLS_VERSION
322 default: '{lftools-version}'
324 Version of lftools to install. Can be a specific version like
325 '0.6.0' or a PEP-440 definition.
326 https://www.python.org/dev/peps/pep-0440/
327 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
330 name: lf-infra-node-parameters
331 # Parameters for NodeJS
335 default: '{node-dir}'
336 description: Path to a Node project directory.
339 default: '{node-version}'
340 description: Version of NodeJS to install.
343 name: lf-infra-tox-parameters
344 # Useful parameters when working with TOX
345 # https://tox.readthedocs.io/
351 Path to directory containing tox.ini file.
354 default: '{tox-envs}'
356 Tox environments to run build against.
357 Example: docs,py2,py3
364 name: lf-infra-properties
367 # Allow build data to be stored at a length configured by the
368 # downstream project.
369 days-to-keep: '{build-days-to-keep}'
370 # Do not allow artifacts to be stored in Jenkins.
371 artifact-num-to-keep: 0
378 name: lf-jacoco-report
381 exec-pattern: "**/**.exec"
382 class-pattern: "**/classes"
383 source-pattern: "**/src/main/java"
384 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
395 name: lf-infra-publish
396 # lf-infra macro to finish up a build.
398 # Handles the following:
399 # - Shipping logs to Nexus logs site repository
400 # - Cleanup workspace
406 script-only-if-succeeded: false
407 script-only-if-failed: false
408 mark-unstable-if-failed: false
411 # Do not clean up *.jenkins-trigger files for jobs that use a
412 # properties file as input for triggering another build.
413 - '**/*.jenkins-trigger'
421 name: lf-infra-gerrit-scm
424 credentials-id: '{jenkins-ssh-credential}'
428 - 'refs/heads/{branch}'
432 recursive: '{submodule-recursive}'
433 choosing-strategy: '{choosing-strategy}'
436 name: lf-infra-github-scm
439 credentials-id: '{jenkins-ssh-credential}'
445 recursive: '{submodule-recursive}'
446 choosing-strategy: '{choosing-strategy}'
453 name: lf-infra-github-pr-trigger
455 - github-pull-request:
456 trigger-phrase: '{trigger-phrase}'
457 only-trigger-phrase: '{only-trigger-phrase}'
458 status-context: '{status-context}'
459 permit-all: '{permit-all}'
460 github-hooks: '{github-hooks}'
461 auto-close-on-fail: false
464 white-list: '{obj:github_pr_whitelist}'
465 admin-list: '{obj:github_pr_admin_list}'
472 name: lf-infra-wrappers
477 timeout: '{build-timeout}'
478 timeout-var: 'BUILD_TIMEOUT'
481 - ssh-agent-credentials:
483 - '{jenkins-ssh-credential}'