Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gitlab-ci
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
gitlab-ci
Commits
3b36836c
Verified
Commit
3b36836c
authored
8 months ago
by
Bartek Jaskulski
Browse files
Options
Downloads
Patches
Plain Diff
refactor: group mkdir, avoid excessive jumps, ensure wp path
Signed-off-by:
Bart Jaskulski
<
bjaskulski@protonmail.com
>
parent
6b38df30
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/tests/codeception.yml
+7
-9
7 additions, 9 deletions
includes/tests/codeception.yml
with
7 additions
and
9 deletions
includes/tests/codeception.yml
+
7
−
9
View file @
3b36836c
...
...
@@ -46,11 +46,12 @@
-
composer config gitlab-token.gitlab.wpdesk.dev gitlab-ci-token ${CI_JOB_TOKEN}
-
echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
-
mkdir -p /cache/wp-cli
-
mkdir -p /project
-
mkdir -p ${APACHE_DOCUMENT_ROOT}
-
mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/{_output,acceptance,functional,unit}
-
export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
-
export WOOTESTS_IP=$(awk '/^[[:space:]]*($|#)/{next} /wootests/{print $1; exit}' /etc/hosts)
-
export TEST_SITE_WP_URL="http://${WOOTESTS_IP}"
-
cd ${CI_PROJECT_DIR}
-
mkdir -p /project
-
|
if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then
set -x
...
...
@@ -58,14 +59,13 @@
cd /project
composer install --no-progress --prefer-dist --no-dev
rm auth.json
cd ${CI_PROJECT_DIR}
set +x
fi
-
cd ${CI_PROJECT_DIR}
-
mkdir -p ${APACHE_DOCUMENT_ROOT}
-
cd ${APACHE_DOCUMENT_ROOT}
-
|
if [ -f ${CI_PROJECT_DIR}/tests/codeception/bootstrap.sh ]; then
set -x
cd ${APACHE_DOCUMENT_ROOT}
wp core download ${WORDPRESS_CLI_PARAMETERS} --allow-root
wp config create --dbhost=${MYSQL_IP} --dbname=wptest --dbuser=mysql --dbpass=mysql --allow-root
wp config set WP_DEBUG true --raw --type=constant --allow-root
...
...
@@ -74,7 +74,6 @@
. ./tests/codeception/bootstrap.sh
set +x
fi
-
cd ${CI_PROJECT_DIR}
-
|
if [ -f ${CI_PROJECT_DIR}/tests/codeception/wpdesk.yml ]; then
set -x
...
...
@@ -82,13 +81,12 @@
composer prepare-local-codeception-tests
set +x
fi
-
mkdir -p ${CI_PROJECT_DIR}/tests/codeception/tests/{_output,acceptance,functional,unit}
-
chmod -R a+w ${APACHE_DOCUMENT_ROOT}/wp-content/uploads
-
touch ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
-
chmod a+w ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
# Always ensure the database is up to date
-
wp core update-db
-
wp wc update ||
true
-
wp
--path="$APACHE_DOCUMENT_ROOT"
core update-db
-
wp
--path="$APACHE_DOCUMENT_ROOT"
wc update ||
true
-
echo "End before"
-
cd ${CI_PROJECT_DIR}
script
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment