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-gpg-verify-git-signature
18 # Verify gpg signature of the latest commit message in $WORKSPACE
20 # This command assumes that $WORKSPACE is a git repo.
22 # TODO: Verify signature after downloading users public key from a locally
23 # created repository instead of the public keymesh. This requires a process
24 # in place to get ODL developers public keys into a local repository without
25 # increasing the job thoughput.
27 - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
30 name: lf-infra-ship-logs
32 - config-file-provider:
34 - file-id: 'jenkins-log-archives-settings'
35 variable: 'SETTINGS_FILE'
36 - lf-infra-create-netrc:
38 - shell: !include-raw:
39 - ../shell/lftools-install.sh
40 - ../shell/logs-deploy.sh
41 - shell: !include-raw:
42 - ../shell/logs-clear-credentials.sh
44 regexp: '^Build logs: .*'
47 name: lf-infra-sysstat
49 - shell: !include-raw:
53 name: lf-jacoco-nojava-workaround
55 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
58 name: lf-maven-install
59 # call maven-target builder with a goal of --version to force Jenkins to
60 # install the needed maven version
62 # Create a $HOME/.wgetrc to make the Maven download quiet.
63 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
65 maven-version: '{mvn-version}'
67 - shell: 'rm "$HOME/.wgetrc"'
70 name: lf-provide-maven-settings
71 # Push a global settings and user settings maven files
73 - config-file-provider:
75 - file-id: '{global-settings-file}'
76 variable: 'GLOBAL_SETTINGS_FILE'
77 - file-id: '{settings-file}'
78 variable: 'SETTINGS_FILE'
80 name: lf-provide-maven-settings-cleanup
81 # Clear maven settings files after we are done using them
85 set +e # DO NOT cause build failure if any of the rm calls fail.
87 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
89 # In some cases we use the lf-provide-maven-settings macro to produce
90 # a "$HOME/.netrc" file containing credentials. Remove that file here
94 # DO NOT fail build if any of the above lines fail.
102 name: lf-infra-parameters
103 # Standard parameters used in the LF CI environments. Gerrit variables are
104 # not used by GitHub projects, but defining them isn't harmful.
110 Parameter to identify a Gerrit project. This is typically the
111 project repo path as exists in Gerrit.
112 For example: ofextensions/circuitsw
117 Parameter to identify Gerrit project. This is typically the
118 project repo path as exists in Gerrit.
119 For example: ofextensions/circuitsw
121 Note that Gerrit will override this parameter automatically if a
122 job is triggered by Gerrit.
127 Parameter to identify a Gerrit branch.
129 Note that Gerrit will override this parameter automatically if a
130 job is triggered by Gerrit.
135 Parameter to identify a refspec when pulling from Gerrit.
137 Note that Gerrit will override this parameter automatically if a
138 job is triggered by Gerrit.
141 name: lf-infra-maven-parameters
145 default: '{mvn-opts}'
147 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
150 default: '{mvn-params}'
152 Maven parameters to pass to the mvn command.
155 # Sets an env var for shell scripts to be able to call the dynamically
156 # installed maven without having to calculate the path themselves.
157 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
158 description: 'Maven selector to be used by shell scripts'
160 name: STAGING_PROFILE_ID
161 default: '{staging-profile-id}'
163 Nexus staging profile ID.
166 name: lf-infra-tox-parameters
167 # Useful parameters when working with TOX
168 # https://tox.readthedocs.io/
174 Path to directory containing tox.ini file.
177 default: '{tox-envs}'
179 Tox environments to run build against.
180 Example: docs,py2,py3
187 name: lf-infra-properties
190 # Allow build data to be stored at a length configured by the
191 # downstream project.
192 days-to-keep: '{build-days-to-keep}'
193 # Do not allow artifacts to be stored in Jenkins.
194 artifact-num-to-keep: 0
201 name: lf-infra-publish
202 # lf-infra macro to finish up a build.
204 # Handles the following:
205 # - Shipping logs to Nexus logs site repository
206 # - Cleanup workspace
212 script-only-if-succeeded: false
213 script-only-if-failed: false
214 mark-unstable-if-failed: false
217 # Do not clean up *.jenkins-trigger files for jobs that use a
218 # properties file as input for triggering another build.
219 - '**/*.jenkins-trigger'
227 name: lf-infra-gerrit-scm
230 credentials-id: '{jenkins-ssh-credential}'
234 - 'refs/heads/{branch}'
238 recursive: '{submodule-recursive}'
239 choosing-strategy: '{choosing-strategy}'
242 name: lf-infra-github-scm
245 credentials-id: '{jenkins-ssh-credential}'
251 recursive: '{submodule-recursive}'
252 choosing-strategy: '{choosing-strategy}'
259 name: lf-infra-wrappers
264 timeout: '{build-timeout}'
265 timeout-var: 'BUILD_TIMEOUT'
268 - ssh-agent-credentials:
270 - '{jenkins-ssh-credential}'