playground/jenkins-pipeline/Jenkinsfile.001

116 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

2021-09-01 12:16:25 +00:00
pipeline {
agent none
environment {
2021-09-01 12:38:59 +00:00
THIS_PROJECT = 'hio'
THIS_SVN_URL = "https://code.miflux.com/svn/hio/trunk/${THIS_PROJECT}"
2021-09-01 12:16:25 +00:00
}
2021-09-01 12:34:03 +00:00
2021-09-01 12:16:25 +00:00
stages {
2021-09-01 13:16:21 +00:00
stage('Pre-builds') {
2021-09-01 12:16:25 +00:00
matrix {
axes {
axis {
name 'BUILD_TYPE'
2021-09-01 13:06:54 +00:00
values 'debug-shared', 'debug-static', 'release-shared', 'release-static'
2021-09-01 12:16:25 +00:00
}
axis {
name 'PLATFORM'
//values 'fedora' , 'freebsd'
values 'fedora'
}
}
2021-09-01 13:06:54 +00:00
2021-09-01 12:16:25 +00:00
//excludes {
// exclude {
// axis {
// name 'BUILD_TYPE'
// value 'debug-shared'
// }
// axis {
// name 'PLATFORM'
// value 'fedora'
// }
// }
//}
//agent any
agent { label "${PLATFORM}" }
stages {
2021-09-01 13:06:54 +00:00
stage('Setup') {
steps {
script {
if (env.BUILD_TYPE == 'debug-shared') {
env.CONFIG_OPTS = '--enable-debug=yes --enable-static=no --enable-shared=yes'
}
else if (env.BUILD_TYPE == 'debug-static') {
env.CONFIG_OPTS = '--enable-debug=yes --enable-static=yes --enable-shared=no'
}
else if (env.BUILD_TYPE == 'release-shared') {
env.CONFIG_OPTS = '--enable-debug=no --enable-static=no --enable-shared=yes'
}
else if (env.BUILD_TYPE == 'release-static') {
env.CONFIG_OPTS = '--enable-debug=no --enable-static=yes --enable-shared=no'
}
else {
echo "Invalid Build Type - ${env.BUILD_TYPE}"
sh "exit 1"
}
}
}
}
2021-09-01 12:16:25 +00:00
stage('Checkout') {
steps {
2021-09-01 13:06:54 +00:00
echo "Checking out for ${BUILD_TYPE} on ${PLATFORM} - ${CONFIG_OPTS}"
2021-09-01 12:16:25 +00:00
checkout([$class: 'SubversionSCM',
additionalCredentials: [],
excludedCommitMessages: '',
excludedRegions: '',
excludedRevprop: '',
excludedUsers: '',
filterChangelog: false,
ignoreDirPropChanges: false,
includedRegions: '',
locations: [[
2021-09-01 13:06:54 +00:00
depthOption: 'infinity',
ignoreExternalsOption: true,
//local: 'local-dir',
remote: "${THIS_SVN_URL}"
]],
workspaceUpdater: [$class: 'UpdateUpdater']
])
2021-09-01 12:16:25 +00:00
}
}
stage('Build') {
steps {
echo "Do build for ${BUILD_TYPE} on ${PLATFORM}"
2021-09-01 13:06:54 +00:00
sh "ls -laF && cd ${THIS_PROJECT} && touch -r * */* && ./configure ${CONFIG_OPTS} && make"
2021-09-01 12:16:25 +00:00
}
}
stage('Test') {
steps {
echo "Do Test for ${BUILD_TYPE} on ${PLATFORM}"
2021-09-01 12:38:59 +00:00
sh "cd ${THIS_PROJECT} && make check"
2021-09-01 12:16:25 +00:00
}
}
}
}
}
2021-09-01 13:16:21 +00:00
stage('RPM build') {
agent { label "fedora" }
steps {
echo "BUILD THE FINAL RPM...."
}
}
2021-09-01 12:16:25 +00:00
}
}