Commit ff9e6013 authored by Andrew Nicols's avatar Andrew Nicols

runTask: Variable assignment must happen in a script

parent ead0f59e
......@@ -50,13 +50,15 @@ def call(String task, String branch, String repo, String phpversion, String data
stage("Detect Moodle Version") {
steps {
moodleversion = sh (
script: 'grep "\$branch" moodle/version.php | sed "s/^[^\']*\'\\([^\']*\\).*\$/\\1/"',
returnStdout: true
).trim()
runner = "${env.PATHTORUNNER}/${moodleversion}"
if (!fileExists(runner)) {
runner "${env.PATHTORUNNER}/master"
script {
moodleversion = sh (
script: 'grep "\$branch" moodle/version.php | sed "s/^[^\']*\'\\([^\']*\\).*\$/\\1/"',
returnStdout: true
).trim()
runner = "${env.PATHTORUNNER}/${moodleversion}"
if (!fileExists(runner)) {
runner "${env.PATHTORUNNER}/master"
}
}
}
}
......
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