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
0c5dc6fd
Commit
0c5dc6fd
authored
Dec 18, 2017
by
Andrew Nicols
Browse files
Task: Get the correct env
parent
25cb8505
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/org/moodle/ci/Task.groovy
View file @
0c5dc6fd
...
...
@@ -4,8 +4,6 @@ import org.moodle.ci.repositories.Repository
import
org.moodle.ci.versions.Version
class
Task
{
def
script
protected
Repository
repository
protected
Version
moodleVersion
...
...
@@ -66,7 +64,7 @@ class Task {
throw
new
Exception
(
"I don't know what PHP Version to test against"
)
}
def
getPathToRunner
()
{
def
getPathToRunner
(
env
)
{
def
runner
if
(
pathToRunner
)
{
runner
=
new
File
(
pathToRunner
)
...
...
@@ -76,9 +74,9 @@ class Task {
return
runner
.
getAbsolutePath
()
}
else
if
(
moodleVersion
)
{
runner
=
new
File
(
"${
script.
env.HOME}/scripts/runner/${moodleVersion.name}/run.sh"
)
runner
=
new
File
(
"${env.HOME}/scripts/runner/${moodleVersion.name}/run.sh"
)
if
(!
runner
.
exists
())
{
runner
=
new
File
(
"${
script.
env.HOME}/scripts/runner/master/run.sh"
)
runner
=
new
File
(
"${env.HOME}/scripts/runner/master/run.sh"
)
}
return
runner
.
getAbsolutePath
()
...
...
@@ -87,10 +85,10 @@ class Task {
script:
'grep "\\$branch" moodle/version.php | sed "s/^[^\']*\'\\([^\']*\\).*\$/\\1/"'
,
returnStdout:
true
).
trim
()
runner
=
new
File
(
"${
script.
env.HOME}/scripts/runner/${versionName}/run.sh"
)
runner
=
new
File
(
"${env.HOME}/scripts/runner/${versionName}/run.sh"
)
if
(!
runner
.
exists
())
{
runner
=
new
File
(
"${
script.
env.HOME}/scripts/runner/master/run.sh"
)
runner
=
new
File
(
"${env.HOME}/scripts/runner/master/run.sh"
)
}
return
runner
.
getAbsolutePath
()
...
...
vars/runTask.groovy
View file @
0c5dc6fd
...
...
@@ -50,7 +50,7 @@ def call(org.moodle.ci.Task task) {
stage
(
"Run Task"
)
{
steps
{
sh
task
.
p
athToRunner
sh
task
.
getP
athToRunner
(
env
)
}
}
...
...
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