Commit 2d93b6ca authored by Andrew Nicols's avatar Andrew Nicols

declarative?

parent d9cddd71
def call(body) {
def config = [:]
def call(String branch, String repo, String task, String phpversion, String database) {
pipeline {
agent label 'docker'
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
body()
node('docker') {
stage("Git Checkout") {
checkout(
[
$class: 'GitSCM',
branches: [
[
name: "*/${config.branch}"
]
],
doGenerateSubmoduleConfigurations: false,
extensions: [
[
$class: 'CloneOption',
depth: 0,
noTags: false,
reference: "${env.HOME}/cache/integration.git",
shallow: false
stages {
stage("Git Checkout") {
checkout(
[
$class: 'GitSCM',
branches: [
[
name: "*/${config.branch}"
]
],
[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'moodle'
]
],
submoduleCfg: [],
userRemoteConfigs: [
[
url: "${config.repo}"
doGenerateSubmoduleConfigurations: false,
extensions: [
[
$class: 'CloneOption',
depth: 0,
noTags: false,
reference: "${env.HOME}/cache/integration.git",
shallow: false
],
[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'moodle'
]
],
submoduleCfg: [],
userRemoteConfigs: [
[
url: "${config.repo}"
]
]
]
]
)
}
)
}
stage("Run ${config.task}") {
withEnv([
"PHP_VERSION=${config.phpversion}",
"DBTYPE=${config.database}",
"TASK=${config.task}"
]) {
sh '$HOME/scripts/runner/master/run.sh'
stage("Run ${config.task}") {
withEnv([
"PHP_VERSION=${config.phpversion}",
"DBTYPE=${config.database}",
"TASK=${config.task}"
]) {
sh '$HOME/scripts/runner/master/run.sh'
}
}
}
stage("Post") {
junit allowEmptyResults: true, testResults: '${env.BUILD_ID}/*.junit/*.xml,${env.BUILD_ID}/*.junit'
archiveArtifacts allowEmptyArchive: true, artifacts: '${env.BUILD_ID}/**'
cleanWs deleteDirs: true, notFailBuild: true
stage("Post") {
junit allowEmptyResults: true, testResults: '${env.BUILD_ID}/*.junit/*.xml,${env.BUILD_ID}/*.junit'
archiveArtifacts allowEmptyArchive: true, artifacts: '${env.BUILD_ID}/**'
cleanWs deleteDirs: true, notFailBuild: true
}
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment