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
dac26f13
Commit
dac26f13
authored
Dec 18, 2017
by
Andrew Nicols
Browse files
Task: File class name
parent
24cdc07d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/org/moodle/ci/Task.groovy
View file @
dac26f13
...
...
@@ -67,33 +67,35 @@ class Task {
}
def
getPathToRunner
()
{
def
runner
if
(
pathToRunner
)
{
if
(!
fileExists
(
pathToRunner
))
{
runner
=
new
File
(
pathToRunner
)
if
(!
runner
.
exists
())
{
throw
new
Exception
(
"Unable to find job runner at ${pathToRunner}"
)
}
return
pathToRunner
return
runner
.
getName
()
}
else
if
(
moodleVersion
)
{
def
runner
=
new
File
(
"${script.env.HOME}/scripts/runner/${moodleVersion.name}/run.sh"
)
runner
=
new
File
(
"${script.env.HOME}/scripts/runner/${moodleVersion.name}/run.sh"
)
if
(!
runner
.
exists
())
{
runner
=
new
File
(
"${script.env.HOME}/scripts/runner/master/run.sh"
)
}
return
runner
return
runner
.
getName
()
}
else
{
def
versionName
=
sh
(
script:
'grep "\\$branch" moodle/version.php | sed "s/^[^\']*\'\\([^\']*\\).*\$/\\1/"'
,
returnStdout:
true
).
trim
()
def
runner
=
new
File
(
"${script.env.HOME}/scripts/runner/${versionName}/run.sh"
)
runner
=
new
File
(
"${script.env.HOME}/scripts/runner/${versionName}/run.sh"
)
if
(!
runner
.
exists
())
{
runner
=
new
File
(
"${script.env.HOME}/scripts/runner/master/run.sh"
)
}
return
runner
return
runner
.
getName
()
}
throw
new
Exception
(
"Unable to determine path to script runner.
Either a moodleVersion or a pathToRunner must be provided
"
)
throw
new
Exception
(
"Unable to determine path to script runner."
)
}
}
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