Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
scripts
mahara-scripts
Commits
1474bf6f
Commit
1474bf6f
authored
Nov 11, 2016
by
Robert Lyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding changes to allow multiple job runs
Signed-off-by:
Robert Lyon
<
robertl@catalyst.net.nz
>
parent
425d8496
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
jenkins/mahara_config.php
jenkins/mahara_config.php
+6
-2
jenkins/mahara_jenkins.php
jenkins/mahara_jenkins.php
+18
-6
No files found.
jenkins/mahara_config.php
View file @
1474bf6f
<?php
$JOBNAME
=
getenv
(
'JOB_NAME'
);
$JOBNAME
=
getenv
(
'
MULTI_
JOB_NAME'
);
$cfg
=
new
stdClass
();
...
...
@@ -26,5 +26,9 @@ $cfg->dbprefix = 'a234567890123456789'; // Check for dbprefix problems
$cfg
->
wwwroot
=
"http://127.0.0.1"
;
$cfg
->
behat_dbprefix
=
'behat_'
;
// must not empty
$cfg
->
behat_dataroot
=
"/var/lib/jenkins/mahara/sitedata/behat_
{
$JOBNAME
}
"
;
$cfg
->
behat_wwwroot
=
"http://localhost:8000"
;
$PHP_PORT
=
getenv
(
"PHP_PORT"
);
$cfg
->
behat_wwwroot
=
"http://localhost:${PHP_PORT}"
;
$SELENIUM_PORT
=
getenv
(
"SELENIUM_PORT"
);
$cfg
->
behat_selenium2
=
"http://127.0.0.1:${SELENIUM_PORT}/wd/hub"
;
jenkins/mahara_jenkins.php
View file @
1474bf6f
...
...
@@ -28,9 +28,21 @@ $GERRIT_BRANCH = getenv('GERRIT_BRANCH');
$GERRIT_CHANGE_ID
=
getenv
(
'GERRIT_CHANGE_ID'
);
$GERRIT_PATCHSET_REVISION
=
getenv
(
'GERRIT_PATCHSET_REVISION'
);
$JOB_NAME
=
getenv
(
'JOB_NAME'
);
$MULTI_JOB_NAME
=
getenv
(
'MULTI_JOB_NAME'
);
$BUILD_URL
=
getenv
(
'BUILD_URL'
);
$HOME
=
getenv
(
'HOME'
);
$PHP_PORT
=
getenv
(
'PHP_PORT'
);
$SELENIUM_PORT
=
getenv
(
'SELENIUM_PORT'
);
if
(
!
$PHP_PORT
)
{
$PHP_PORT
=
8000
;
}
if
(
!
$SELENIUM_PORT
)
{
$SELENIUM_PORT
=
4444
;
}
/**
* Environment variables set by us in the Jenkins project itself.
*/
...
...
@@ -316,14 +328,14 @@ passthru_or_die(
echo
"
\n
"
;
echo
"########## Run installer
\n
"
;
echo
"
\n
"
;
passthru
(
"dropdb
$JOB_NAME
"
);
passthru_or_die
(
"rm -Rf
$HOME
/mahara/sitedata/
$JOB_NAME
/*"
);
passthru_or_die
(
"rm -Rf
$HOME
/mahara/sitedata/behat_
$JOB_NAME
/*"
);
passthru_or_die
(
"createdb -O jenkins -E utf8
$JOB_NAME
"
);
passthru
(
"dropdb
$
MULTI_
JOB_NAME
"
);
passthru_or_die
(
"rm -Rf
$HOME
/mahara/sitedata/
$
MULTI_
JOB_NAME
/*"
);
passthru_or_die
(
"rm -Rf
$HOME
/mahara/sitedata/behat_
$
MULTI_
JOB_NAME
/*"
);
passthru_or_die
(
"createdb -O jenkins -E utf8
$
MULTI_
JOB_NAME
"
);
chdir
(
'htdocs'
);
passthru_or_die
(
"cp
$HOME
/mahara/mahara-scripts/jenkins/mahara_config.php config.php"
);
passthru_or_die
(
PHP_BINARY
.
" admin/cli/install.php --adminpassword='password' --adminemail=never@example.com"
);
passthru_or_die
(
"PHP_PORT=${PHP_PORT} "
.
PHP_BINARY
.
" admin/cli/install.php --adminpassword='password' --adminemail=never@example.com"
);
chdir
(
'..'
);
# Check if composer is not available
...
...
@@ -357,7 +369,7 @@ echo "########## Run Behat tests\n";
echo
"
\n
"
;
passthru_or_die
(
'
test/behat/mahara_behat.sh runheadless
'
,
"MULTI_JOB_NAME=${MULTI_JOB_NAME} PHP_PORT=${PHP_PORT} SELENIUM_PORT=${SELENIUM_PORT}
test/behat/mahara_behat.sh runheadless
"
,
"This patch caused one or more Behat tests to fail.
\n\n
"
.
$BUILD_URL
.
"console
\n\n
"
.
"Please see the console output on test.mahara.org for details, and fix any failing tests."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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