Commit 4a14b057 authored by Andrew Nicols's avatar Andrew Nicols

wip

parent a79de77c
package org.moodle.ci.branches;
class Branch {
protected String defaultBranch
protected Array supportedPHPVersions
protected Array supportedDatabases
def getDefaultBranch() {
return this.defaultBranch
}
def getPhpVersions() {
return this.supportedPHPVersions
}
def getDatabases() {
return this.supportedPHPVersions
}
def getHighestSupportedVersion() {
def versions = self.getPhpVersions()
return versions[versions.size() - 1]
}
def getLowestSupportedVersion(branch) {
def versions = self.getPhpVersions()
return versions[0]
}
}
package org.moodle.ci.branches.Master;
package org.moodle.ci.branches;
def getPhpVersions() {
return [
"7.0",
"7.1",
]
class Master extends Branch {
Master() {
super(
defaultBranch = "master",
supportedPHPVersions = [
"7.0",
"7.1",
],
supportedDatabases = [
"pgsql",
"mysqli",
"mariadb",
"sqlsrv",
"oci",
]
)
}
}
def getDatabases() {
return [
"pgsql",
"mysqli",
"mariadb",
"sqlsrv",
"oci",
]
}
return this;
package org.moodle.ci.repositories;
class Integration extends Repository {
}
package org.moodle.ci.repositories;
def getUrl() {
return "https://git.in.moodle.com/moodle/integration.git"
class Integration extends Repository {
def getUrl() {
return "https://git.in.moodle.com/moodle/integration.git"
}
}
def getBranch() {
return "master"
}
return this
def call(body) {
def config = [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
body()
node('docker') {
stage("Git Checkout") {
checkout(
[
$class: 'GitSCM',
branches: [
[
name: "*/${branch}"
]
],
doGenerateSubmoduleConfigurations: false,
extensions: [
[
$class: 'CloneOption',
depth: 0,
noTags: false,
reference: "${env.HOME}/cache/integration.git",
shallow: false
],
[
$class: 'RelativeTargetDirectory',
relativeTargetDir: 'moodle'
]
],
submoduleCfg: [],
userRemoteConfigs: [
[
url: "${repo}"
]
]
]
)
}
stage("Run ${task}") {
withEnv([
"PHP_VERSION=${phpversion}",
"DBTYPE=${database}",
"TASK=${task}"
]) {
sh '$HOME/scripts/runner/master/run.sh'
}
}
stage("Post") {
junit allowEmptyResults: true, testResults: '$BUILD_ID/*.junit/*.xml,$BUILD_ID/*.junit'
archiveArtifacts allowEmptyArchive: true, artifacts: '$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