blob: d39c1f6b3f63391e08d86e963731a2366ed0729b [file] [log] [blame]
---
# maven jobs for Java projects
- job-template:
id: maven-test
name: 'verify_{project}_maven-test{name-extension}'
description: |
<!-- Managed by Jenkins Job Builder -->
Created by {id} job-template from ci-management/jjb/maven.yaml
node: 'ubuntu16.04-basebuild-1c-2g'
project-type: freestyle
parameters:
- string:
name: jdkDistro
default: '{jdk-distribution}'
description: 'Distribution of the JDK to use with update-java-alternatives'
triggers:
- cord-infra-gerrit-trigger-patchset:
gerrit-server-name: '{gerrit-server-name}'
project-regexp: '{project}'
branch-regexp: '{branch-regexp}'
file-include-regexp: '{all-files-regexp}'
dependency-jobs: '{dependency-jobs}'
properties:
- cord-infra-properties:
build-days-to-keep: '{build-days-to-keep}'
artifact-num-to-keep: '{artifact-num-to-keep}'
scm:
- lf-infra-gerrit-scm:
git-url: '$GIT_URL/$GERRIT_PROJECT'
refspec: '$GERRIT_REFSPEC'
branch: '$GERRIT_BRANCH'
submodule-recursive: 'false'
choosing-strategy: gerrit
jenkins-ssh-credential: '{jenkins-ssh-credential}'
builders:
# Set JDK version
- shell: |
#!/usr/bin/env bash
set -eu -o pipefail
echo "Setting JDK Distro to: $jdkDistro"
sudo update-java-alternatives -s $jdkDistro
echo "Java Version:"
java -version
# run tests and install
- maven-target:
pom: pom.xml
settings: 'cord-apps-maven-settings'
settings-type: cfp
goals: 'clean test install'
publishers:
- junit:
results: "**/TEST-*.xml"
allow-empty-results: '{junit-allow-empty-results}'
- cobertura:
report-file: "**/*coverage.xml"
targets:
- files:
healthy: 80
unhealthy: 0
failing: 0
- method:
healthy: 50
unhealthy: 0
failing: 0
- job-template:
id: maven-publish
name: 'maven-publish{name-extension}_{project}'
description: |
<!-- Managed by Jenkins Job Builder -->
Created by {id} job-template from ci-management/jjb/maven.yaml
node: 'ubuntu16.04-basebuild-1c-2g'
project-type: freestyle
parameters:
- string:
name: jdkDistro
default: '{jdk-distribution}'
description: 'Distribution of the JDK to use with update-java-alternatives'
triggers:
- cord-infra-gerrit-trigger-merge:
gerrit-server-name: '{gerrit-server-name}'
project-regexp: '{project}'
branch-regexp: '{branch-regexp}'
file-include-regexp: '{all-files-regexp}'
dependency-jobs: '{dependency-jobs}'
properties:
- cord-infra-properties:
build-days-to-keep: '{build-days-to-keep}'
artifact-num-to-keep: '{artifact-num-to-keep}'
scm:
- lf-infra-gerrit-scm:
git-url: '$GIT_URL/$GERRIT_PROJECT'
refspec: '$GERRIT_REFSPEC'
branch: '$GERRIT_BRANCH'
submodule-recursive: 'false'
choosing-strategy: gerrit
jenkins-ssh-credential: '{jenkins-ssh-credential}'
wrappers:
- credentials-binding:
- file:
credential-id: 'gpg-creds-maven'
variable: 'GNUPG'
builders:
# Set JDK version
- shell: |
#!/usr/bin/env bash
set -eu -o pipefail
echo "Setting JDK Distro to: $jdkDistro"
sudo update-java-alternatives -s $jdkDistro
echo "Java Version:"
java -version
echo "Unpacking GPG Keys"
tar -xvf $GNUPG -C ~
- maven-target:
pom: pom.xml
settings: 'cord-apps-maven-settings'
settings-type: cfp
goals: '-Prelease clean deploy'