Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All upstream Jenkins jobs related to Mandrel are encoded in Jenkins DSL now #81

Merged
merged 2 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions jenkins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Mandrel Jenkins jobs

Mandrel jobs use [Jenkins Job DSL](https://github.com/jenkinsci/job-dsl-plugin), a Groovy-based DSL.

Useful links:

- [Job DSL API viewer on Jenkins](https://ci.modcluster.io/plugin/job-dsl/api-viewer/index.html)

## Update job
- If you run [mandrel-jobs](https://ci.modcluster.io/job/mandrel-jobs/) you regenerate Jenkins jobs definitions.
82 changes: 82 additions & 0 deletions jenkins/jobs/graal_windows_quarkus_tests.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
matrixJob('graal-windows-quarkus-tests') {
axes {
text('GRAAL_VERSION',
'20.3.0',
'20.2.0'
)
text('QUARKUS_VERSION',
'1.11.0.Beta1',
'master'
)
labelExpression('LABEL', ['w2k19'])
}
description('Run Quarkus TS with GraalVM distros.')
displayName('Windows (Graal) :: Quarkus TS')
logRotator {
numToKeep(3)
}
childCustomWorkspace('${SHORT_COMBINATION}')
wrappers {
timestamps()
timeout {
absolute(360)
}
}
combinationFilter('(GRAAL_VERSION=="20.3.0" && QUARKUS_VERSION=="master") ||' +
' (GRAAL_VERSION=="20.2.0" && QUARKUS_VERSION=="1.11.0.Beta1")')
parameters {
stringParam('QUARKUS_REPO', 'https://github.com/quarkusio/quarkus.git', 'Quarkus repository.')
}
steps {
batchFile('''
REM Prepare Mandrel
@echo off
call vcvars64
IF NOT %ERRORLEVEL% == 0 ( exit 1 )

set "GRAALVM_HOME=C:\\Program Files\\graalvm-ce-java11-%GRAAL_VERSION%"
set "JAVA_HOME=%GRAALVM_HOME%"
set "PATH=%JAVA_HOME%\\bin;%PATH%"

if not exist "%GRAALVM_HOME%\\bin\\native-image.cmd" (
echo "Cannot find native-image tool. Quitting..."
exit 1
) else (
echo "native-image.cmd is present, good."
cmd /C native-image --version
)

REM Prepare Quarkus
git clone --depth 1 --branch %QUARKUS_VERSION% %QUARKUS_REPO%
cd quarkus

REM Build and test Quarkus

set "MODULES=-pl !google-cloud-functions,!google-cloud-functions-http,!kubernetes/maven-invoker-way,!kubernetes-client"

mvnw clean install -DskipTests -pl '!docs' & mvnw verify -f integration-tests/pom.xml --fail-at-end --batch-mode -DfailIfNoTests=false -Dnative %MODULES%

''')
}
publishers {
archiveJunit('**/target/*-reports/*.xml') {
allowEmptyResults(false)
retainLongStdout(false)
healthScaleFactor(1.0)
}
archiveArtifacts('**/target/*-reports/*.xml')

extendedEmail {
recipientList('[email protected]')
triggers {
failure {
sendTo {
recipientList()
attachBuildLog(true)
}
}
}
}
wsCleanup()
}
}
139 changes: 139 additions & 0 deletions jenkins/jobs/mandrel_20_1_linux_build.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
job('mandrel-20.1-linux-build') {
label 'centos8'
displayName('Linux Build :: 20.1')
description('''
Linux build for 20.1 branch.
''')
logRotator {
numToKeep(5)
}
parameters {
choiceParam(
'REPOSITORY',
[
'https://github.com/graalvm/mandrel.git',
'https://github.com/jerboaa/graal.git',
'https://github.com/Karm/graal.git',
'https://github.com/zakkak/mandrel.git',
],
'Mandrel repo'
)
choiceParam(
'HEADS_OR_TAGS',
[
'heads',
'tags',

],
'To be used with the repository, e.g. to use a certain head or a tag.'
)
stringParam(
'BRANCH_OR_TAG',
'mandrel/20.1',
'e.g. your PR branch or a specific tag.'
)
choiceParam(
'OPENJDK',
[
'openjdk-11.0.9_11',
'openjdk-11-ea',
'openjdk-11-latest'
zakkak marked this conversation as resolved.
Show resolved Hide resolved

],
'OpenJDK including Static libs'
)
choiceParam(
'PACKAGING_REPOSITORY',
[
'https://github.com/mandrel/mandrel-packaging.git',
'https://github.com/Karm/mandrel-packaging.git',
'https://github.com/zakkak/mandrel-packaging.git'
],
'Mandrel packaging scripts.'
)
choiceParam(
'PACKAGING_REPOSITORY_HEADS_OR_TAGS',
[
'heads',
'tags',

],
'To be used with the repository, e.g. to use a certain head or a tag.'
)
stringParam(
'PACKAGING_REPOSITORY_BRANCH_OR_TAG',
'20.1',
'e.g. master if you use heads or some tag if you use tags.'
)
stringParam(
'MANDREL_VERSION_SUBSTRING',
'20.1-SNAPSHOT',
'''Used as a part of Mandrel version, i.e. <pre>export MANDREL_VERSION="${MANDREL_VERSION_SUBSTRING}
git rev.: $( git log --pretty=format:%h -n1 ) </pre> it defaults to <pre>${BRANCH_OR_TAG}</pre>.
Could be e.g. 20.1.0.0.Alpha1. It must not contain spaces as it is used in tarball name too.'''
)
}
multiscm {
git {
remote {
url('${PACKAGING_REPOSITORY}')
}
branches('refs/${PACKAGING_REPOSITORY_HEADS_OR_TAGS}/${PACKAGING_REPOSITORY_BRANCH_OR_TAG}')
extensions {
localBranch('${PACKAGING_REPOSITORY_BRANCH_OR_TAG}')
}
}
git {
remote {
url('${REPOSITORY}')
}
branches('refs/${HEADS_OR_TAGS}/${BRANCH_OR_TAG}')
extensions {
localBranch('${BRANCH_OR_TAG}')
relativeTargetDirectory('mandrel')
}
}
git {
remote {
url('https://github.com/graalvm/mx.git')
}
branches('*/master')
extensions {
localBranch('master')
relativeTargetDirectory('mx')
}
}
}
triggers {
scm('H H/2 * * *')
}
steps {
shell('echo MANDREL_VERSION_SUBSTRING=${MANDREL_VERSION_SUBSTRING}')
buildDescription(/MANDREL_VERSION_SUBSTRING=([^\s]*)/, '\\1')
shell('./jenkins/jobs/scripts/mandrel_linux_build.sh')
}
publishers {
archiveArtifacts('*.tar.gz,MANDREL.md,*.sha1,*.sha256')
wsCleanup()
extendedEmail {
recipientList('[email protected],[email protected]')
triggers {
failure {
sendTo {
recipientList()
attachBuildLog(true)
}
}
}
}
downstreamParameterized {
trigger(['mandrel-linux-quarkus-tests/LABEL=el8,MANDREL_VERSION=20.1,QUARKUS_VERSION=1.7.5.Final/',
'mandrel-linux-integration-tests/MANDREL_VERSION=20.1,label=el8']) {
condition('SUCCESS')
parameters {
currentBuild()
}
}
}
}
}
138 changes: 138 additions & 0 deletions jenkins/jobs/mandrel_20_2_linux_build.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
job('mandrel-20.2-linux-build') {
label 'centos8'
displayName('Linux Build :: 20.2')
description('''
Linux build for 20.2 branch.
''')
logRotator {
numToKeep(5)
}
parameters {
choiceParam(
'REPOSITORY',
[
'https://github.com/graalvm/mandrel.git',
'https://github.com/jerboaa/graal.git',
'https://github.com/Karm/graal.git',
'https://github.com/zakkak/mandrel.git',
],
'Mandrel repo'
)
choiceParam(
'HEADS_OR_TAGS',
[
'heads',
'tags',

],
'To be used with the repository, e.g. to use a certain head or a tag.'
)
stringParam(
'BRANCH_OR_TAG',
'mandrel/20.2',
'e.g. your PR branch or a specific tag.'
)
choiceParam(
'OPENJDK',
[
'openjdk-11.0.9_11',
'openjdk-11-ea',
'openjdk-11-latest'

],
'OpenJDK including Static libs'
)
choiceParam(
'PACKAGING_REPOSITORY',
[
'https://github.com/mandrel/mandrel-packaging.git',
'https://github.com/Karm/mandrel-packaging.git',
'https://github.com/zakkak/mandrel-packaging.git'
],
'Mandrel packaging scripts.'
)
choiceParam(
'PACKAGING_REPOSITORY_HEADS_OR_TAGS',
[
'heads',
'tags',

],
'To be used with the repository, e.g. to use a certain head or a tag.'
)
stringParam(
'PACKAGING_REPOSITORY_BRANCH_OR_TAG',
'20.1',
'e.g. master if you use heads or some tag if you use tags.'
)
stringParam(
'MANDREL_VERSION_SUBSTRING',
'20.2-SNAPSHOT',
'''Used as a part of Mandrel version, i.e. <pre>export MANDREL_VERSION="${MANDREL_VERSION_SUBSTRING}
git rev.: $( git log --pretty=format:%h -n1 ) </pre> it defaults to <pre>${BRANCH_OR_TAG}</pre>.
Could be e.g. 20.1.0.0.Alpha1. It must not contain spaces as it is used in tarball name too.'''
)
}
multiscm {
git {
remote {
url('${PACKAGING_REPOSITORY}')
}
branches('refs/${PACKAGING_REPOSITORY_HEADS_OR_TAGS}/${PACKAGING_REPOSITORY_BRANCH_OR_TAG}')
extensions {
localBranch('${PACKAGING_REPOSITORY_BRANCH_OR_TAG}')
}
}
git {
remote {
url('${REPOSITORY}')
}
branches('refs/${HEADS_OR_TAGS}/${BRANCH_OR_TAG}')
extensions {
localBranch('${BRANCH_OR_TAG}')
relativeTargetDirectory('mandrel')
}
}
git {
remote {
url('https://github.com/graalvm/mx.git')
}
branches('*/master')
extensions {
localBranch('master')
relativeTargetDirectory('mx')
}
}
}
triggers {
scm('H H/2 * * *')
}
steps {
shell('echo MANDREL_VERSION_SUBSTRING=${MANDREL_VERSION_SUBSTRING}')
buildDescription(/MANDREL_VERSION_SUBSTRING=([^\s]*)/, '\\1')
shell('./jenkins/jobs/scripts/mandrel_linux_build.sh')
}
publishers {
archiveArtifacts('*.tar.gz,MANDREL.md,*.sha1,*.sha256')
wsCleanup()
extendedEmail {
recipientList('[email protected],[email protected]')
triggers {
failure {
sendTo {
recipientList()
attachBuildLog(true)
}
}
}
}
downstreamParameterized {
trigger(['mandrel-linux-integration-tests/MANDREL_VERSION=20.2,label=el8']) {
Karm marked this conversation as resolved.
Show resolved Hide resolved
condition('SUCCESS')
parameters {
currentBuild()
}
}
}
}
}
Loading