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-infra-deploy-maven-file
59 # Deploy files to a repository.
61 # The builder requires passing the following parameters
62 # REPO_ID: Repository ID
63 # GROUP_ID: Group ID of the repository
64 # UPLOAD_FILES_PATH: Path to directory containing one or more files
67 mvn-version: '{mvn-version}'
68 - lf-provide-maven-settings:
69 global-settings-file: '{global-settings-file}'
70 settings-file: '{settings-file}'
75 UPLOAD_FILES_PATH={files-dir}
76 - shell: !include-raw-escape:
77 - ../shell/lftools-install.sh
78 - ../shell/deploy-maven-file.sh
79 - lf-provide-maven-settings-cleanup
82 name: lf-maven-install
83 # call maven-target builder with a goal of --version to force Jenkins to
84 # install the needed maven version
86 # Create a $HOME/.wgetrc to make the Maven download quiet.
87 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
89 maven-version: '{mvn-version}'
91 - shell: 'rm "$HOME/.wgetrc"'
94 name: lf-provide-maven-settings
95 # Push a global settings and user settings maven files
97 - config-file-provider:
99 - file-id: '{global-settings-file}'
100 variable: 'GLOBAL_SETTINGS_FILE'
101 - file-id: '{settings-file}'
102 variable: 'SETTINGS_FILE'
105 name: lf-provide-maven-settings-cleanup
106 # Clear maven settings files after we are done using them
110 set +e # DO NOT cause build failure if any of the rm calls fail.
112 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
114 # In some cases we use the lf-provide-maven-settings macro to produce
115 # a "$HOME/.netrc" file containing credentials. Remove that file here
119 # DO NOT fail build if any of the above lines fail.
127 name: lf-infra-parameters
128 # Standard parameters used in the LF CI environments. Gerrit variables are
129 # not used by GitHub projects, but defining them isn't harmful.
135 Parameter to identify a Gerrit project. This is typically the
136 project repo path as exists in Gerrit.
137 For example: ofextensions/circuitsw
142 Parameter to identify Gerrit project. This is typically the
143 project repo path as exists in Gerrit.
144 For example: ofextensions/circuitsw
146 Note that Gerrit will override this parameter automatically if a
147 job is triggered by Gerrit.
152 Parameter to identify a Gerrit branch.
154 Note that Gerrit will override this parameter automatically if a
155 job is triggered by Gerrit.
160 Parameter to identify a refspec when pulling from Gerrit.
162 Note that Gerrit will override this parameter automatically if a
163 job is triggered by Gerrit.
166 name: lf-infra-maven-parameters
170 default: '{mvn-opts}'
172 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
175 default: '{mvn-params}'
177 Maven parameters to pass to the mvn command.
180 # Sets an env var for shell scripts to be able to call the dynamically
181 # installed maven without having to calculate the path themselves.
182 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
183 description: 'Maven selector to be used by shell scripts'
185 name: STAGING_PROFILE_ID
186 default: '{staging-profile-id}'
188 Nexus staging profile ID.
191 name: lf-infra-tox-parameters
192 # Useful parameters when working with TOX
193 # https://tox.readthedocs.io/
199 Path to directory containing tox.ini file.
202 default: '{tox-envs}'
204 Tox environments to run build against.
205 Example: docs,py2,py3
212 name: lf-infra-properties
215 # Allow build data to be stored at a length configured by the
216 # downstream project.
217 days-to-keep: '{build-days-to-keep}'
218 # Do not allow artifacts to be stored in Jenkins.
219 artifact-num-to-keep: 0
226 name: lf-infra-publish
227 # lf-infra macro to finish up a build.
229 # Handles the following:
230 # - Shipping logs to Nexus logs site repository
231 # - Cleanup workspace
237 script-only-if-succeeded: false
238 script-only-if-failed: false
239 mark-unstable-if-failed: false
242 # Do not clean up *.jenkins-trigger files for jobs that use a
243 # properties file as input for triggering another build.
244 - '**/*.jenkins-trigger'
252 name: lf-infra-gerrit-scm
255 credentials-id: '{jenkins-ssh-credential}'
259 - 'refs/heads/{branch}'
263 recursive: '{submodule-recursive}'
264 choosing-strategy: '{choosing-strategy}'
267 name: lf-infra-github-scm
270 credentials-id: '{jenkins-ssh-credential}'
276 recursive: '{submodule-recursive}'
277 choosing-strategy: '{choosing-strategy}'
284 name: lf-infra-wrappers
289 timeout: '{build-timeout}'
290 timeout-var: 'BUILD_TIMEOUT'
293 - ssh-agent-credentials:
295 - '{jenkins-ssh-credential}'