7 name: lf-infra-create-netrc
8 # Macro to create a ~/.netrc file from a Maven settings.xml
10 # {server-id} The id of a server as defined in settings.xml
13 properties-content: 'SERVER_ID={server-id}'
14 - shell: !include-raw-escape: ../shell/create-netrc.sh
17 name: lf-infra-docker-login
18 # Login into a custom hosted docker registry and / or docker.io
20 # The Jenkins system should have the following global variables defined
22 # DOCKER_REGISTRY : Optional
23 # The DNS address of the registry (IP or FQDN)
24 # ex: nexus3.example.com
26 # REGISTRY_PORTS : Required if DOCKER_REGISTRY is set
27 # Space separated listing of the registry ports to login
29 # ex: 10001 10002 10003 10004
31 # DOCKERHUB_EMAIL : Optional
32 # If this variable is set then an attempt to login to
33 # DockerHub (docker.io) will be also made. It should be
34 # set to the email address for the credentials that will
35 # get looked up. Only _one_ credential will ever be found
36 # in the maven settings file for DockerHub
38 - lf-provide-maven-settings:
39 global-settings-file: '{global-settings-file}'
40 settings-file: '{settings-file}'
41 - shell: !include-raw-escape: ../shell/docker-login.sh
42 - lf-provide-maven-settings-cleanup
45 name: lf-infra-gpg-verify-git-signature
46 # Verify gpg signature of the latest commit message in $WORKSPACE
48 # This command assumes that $WORKSPACE is a git repo.
50 # TODO: Verify signature after downloading users public key from a locally
51 # created repository instead of the public keymesh. This requires a process
52 # in place to get ODL developers public keys into a local repository without
53 # increasing the job thoughput.
55 - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
58 name: lf-infra-ship-logs
60 - config-file-provider:
62 - file-id: 'jenkins-log-archives-settings'
63 variable: 'SETTINGS_FILE'
64 - lf-infra-create-netrc:
66 - shell: !include-raw:
67 - ../shell/lftools-install.sh
68 - ../shell/logs-deploy.sh
69 - shell: !include-raw:
70 - ../shell/logs-clear-credentials.sh
72 regexp: '^Build logs: .*'
75 name: lf-infra-sysstat
77 - shell: !include-raw:
81 name: lf-jacoco-nojava-workaround
83 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
86 name: lf-maven-install
87 # call maven-target builder with a goal of --version to force Jenkins to
88 # install the needed maven version
90 # Create a $HOME/.wgetrc to make the Maven download quiet.
91 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
93 maven-version: '{mvn-version}'
95 - shell: 'rm "$HOME/.wgetrc"'
98 name: lf-provide-maven-settings
99 # Push a global settings and user settings maven files
101 - config-file-provider:
103 - file-id: '{global-settings-file}'
104 variable: 'GLOBAL_SETTINGS_FILE'
105 - file-id: '{settings-file}'
106 variable: 'SETTINGS_FILE'
108 name: lf-provide-maven-settings-cleanup
109 # Clear maven settings files after we are done using them
113 set +e # DO NOT cause build failure if any of the rm calls fail.
115 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
117 # In some cases we use the lf-provide-maven-settings macro to produce
118 # a "$HOME/.netrc" file containing credentials. Remove that file here
122 # DO NOT fail build if any of the above lines fail.
130 name: lf-infra-parameters
131 # Standard parameters used in the LF CI environments. Gerrit variables are
132 # not used by GitHub projects, but defining them isn't harmful.
138 Parameter to identify a Gerrit project. This is typically the
139 project repo path as exists in Gerrit.
140 For example: ofextensions/circuitsw
145 Parameter to identify Gerrit project. This is typically the
146 project repo path as exists in Gerrit.
147 For example: ofextensions/circuitsw
149 Note that Gerrit will override this parameter automatically if a
150 job is triggered by Gerrit.
155 Parameter to identify a Gerrit branch.
157 Note that Gerrit will override this parameter automatically if a
158 job is triggered by Gerrit.
163 Parameter to identify a refspec when pulling from Gerrit.
165 Note that Gerrit will override this parameter automatically if a
166 job is triggered by Gerrit.
169 name: lf-infra-maven-parameters
173 default: '{mvn-opts}'
175 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
178 default: '{mvn-params}'
180 Maven parameters to pass to the mvn command.
183 # Sets an env var for shell scripts to be able to call the dynamically
184 # installed maven without having to calculate the path themselves.
185 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
186 description: 'Maven selector to be used by shell scripts'
188 name: STAGING_PROFILE_ID
189 default: '{staging-profile-id}'
191 Nexus staging profile ID.
194 name: lf-infra-tox-parameters
195 # Useful parameters when working with TOX
196 # https://tox.readthedocs.io/
202 Path to directory containing tox.ini file.
205 default: '{tox-envs}'
207 Tox environments to run build against.
208 Example: docs,py2,py3
215 name: lf-infra-properties
218 # Allow build data to be stored at a length configured by the
219 # downstream project.
220 days-to-keep: '{build-days-to-keep}'
221 # Do not allow artifacts to be stored in Jenkins.
222 artifact-num-to-keep: 0
229 name: lf-infra-publish
230 # lf-infra macro to finish up a build.
232 # Handles the following:
233 # - Shipping logs to Nexus logs site repository
234 # - Cleanup workspace
240 script-only-if-succeeded: false
241 script-only-if-failed: false
242 mark-unstable-if-failed: false
245 # Do not clean up *.jenkins-trigger files for jobs that use a
246 # properties file as input for triggering another build.
247 - '**/*.jenkins-trigger'
255 name: lf-infra-gerrit-scm
258 credentials-id: '{jenkins-ssh-credential}'
262 - 'refs/heads/{branch}'
266 recursive: '{submodule-recursive}'
267 choosing-strategy: '{choosing-strategy}'
270 name: lf-infra-github-scm
273 credentials-id: '{jenkins-ssh-credential}'
279 recursive: '{submodule-recursive}'
280 choosing-strategy: '{choosing-strategy}'
287 name: lf-infra-wrappers
292 timeout: '{build-timeout}'
293 timeout-var: 'BUILD_TIMEOUT'
296 - ssh-agent-credentials:
298 - '{jenkins-ssh-credential}'