Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Lyons
pipeline
Commits
0792b7ba
Commit
0792b7ba
authored
Dec 17, 2017
by
Andrew Nicols
Browse files
Task: Get better at guessing the pathToRunner
parent
be34b4d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/org/moodle/ci/Task.groovy
View file @
0792b7ba
...
...
@@ -4,6 +4,8 @@ import org.moodle.ci.repositories.Repository
import
org.moodle.ci.versions.Version
class
Task
{
def
script
protected
Repository
repository
protected
Version
moodleVersion
...
...
@@ -72,12 +74,22 @@ class Task {
return
pathToRunner
}
else
if
(
moodleVersion
)
{
runner
=
"${env.PATHTORUNNER}/${moodleVersion.name}/run.sh"
runner
=
"${
script.
env.PATHTORUNNER}/${moodleVersion.name}/run.sh"
if
(!
fileExists
(
runner
))
{
runner
=
"${env.PATHTORUNNER}/master/run.sh"
runner
=
"${
script.
env.PATHTORUNNER}/master/run.sh"
}
return
runner
}
else
{
versionName
=
sh
(
script:
'grep "\\$branch" moodle/version.php | sed "s/^[^\']*\'\\([^\']*\\).*\$/\\1/"'
,
returnStdout:
true
).
trim
()
runner
=
"${script.env.PATHTORUNNER}/${versionName}/run.sh"
if
(!
fileExists
(
runner
))
{
runner
=
"${script.env.PATHTORUNNER}/master/run.sh"
}
}
throw
new
Exception
(
"Unable to determine path to script runner. Either a moodleVersion or a pathToRunner must be provided"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment