Commit 11f99902 authored by Andrew Nicols's avatar Andrew Nicols

runTask: Detect Moodle version

parent a6ba511f
......@@ -8,8 +8,10 @@ def call(String task, String branch, String repo, String phpversion, String data
PHP_VERSION = "${phpversion}"
DBTYPE = "${database}"
TASK = "${task}"
PATHTORUNNER = "${HOME}/scripts/runner"
}
stages {
stage("Git Checkout") {
steps {
......@@ -46,9 +48,19 @@ def call(String task, String branch, String repo, String phpversion, String data
}
}
stage("Detect Moodle Version") {
steps {
moodleversion = sh grep '$branch' moodle/version.php | sed "s/^[^']*'\([^']*\).*$/\1/"
runner = "${env.PATHTORUNNER}/${moodleversion}"
if (!fileExists(runner)) {
runner "${env.PATHTORUNNER}/master"
}
}
}
stage("Run Task") {
steps {
sh '$HOME/scripts/runner/master/run.sh'
sh "${pathtorunner}/run.sh"
}
}
......
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