Commit 47cf26f9 authored by Sandeep Kadam's avatar Sandeep Kadam

Fix local deployment for EBI Academy WP multisite

parent ede9967e
......@@ -131,7 +131,12 @@ case "${COMMAND}" in
quick)
${ROOT}/bin/dump sql $*;
${ROOT}/bin/dump files $*;
${ROOT}/bin/dev up;
if [ "${PROJECT_NAME}" = "ebi.ac.uk.training-beta.online.courses" ]; then
${ROOT}/bin/dev up_academy;
else
${ROOT}/bin/dev up;
fi;
DOCKER_URL=${PROJECT_NAME}.docker.localhost;
DOCKER_PORT=$(docker-compose port traefik 80 | cut -d: -f2);
SITE_URL=http://${DOCKER_URL}:${DOCKER_PORT};
......@@ -139,9 +144,14 @@ case "${COMMAND}" in
${ROOT}/bin/dev db_wait;
${ROOT}/bin/dev create_config;
${ROOT}/bin/dev create_symlinks
${ROOT}/bin/dev ssh "cd ${RELATIVE_DOCUMENT_ROOT} && wp config set WP_SITEURL $SITE_URL &&
wp config set WP_HOME $SITE_URL";
${ROOT}/bin/dev create_htaccess;
if [ "${PROJECT_NAME}" = "ebi.ac.uk.training-beta.online.courses" ]; then
sh ${ROOT}/custom_scripts/convert_ms_local.sh 'up'
else
${ROOT}/bin/dev ssh "cd ${RELATIVE_DOCUMENT_ROOT} && wp config set WP_SITEURL $SITE_URL &&
wp config set WP_HOME $SITE_URL";
${ROOT}/bin/dev create_htaccess;
fi;
${ROOT}/bin/dev login;
;;
......@@ -205,6 +215,7 @@ wp config set WP_HOME $SITE_URL";
;;
pre_up)
${ROOT}/bin/dev create_directories
${ROOT}/bin/dev create-vendor
;;
......@@ -221,6 +232,12 @@ wp config set WP_HOME $SITE_URL";
post_up)
#${ROOT}/bin/dev create_symlinks
if [ "${PROJECT_NAME}" = "ebi.ac.uk.training-beta.online.courses" ]; then
${ROOT}/bin/dev create_config;
${ROOT}/bin/dev create_symlinks
${ROOT}/bin/dev db_wait;
sh ${ROOT}/custom_scripts/convert_ms_local.sh 'up'
fi
;;
# spin up docker containers
......@@ -232,6 +249,14 @@ wp config set WP_HOME $SITE_URL";
${ROOT}/bin/dev post_up;
;;
# spin up docker containers
up_academy)
echo "Starting up containers for for ${PROJECT_NAME}..."
${ROOT}/bin/dev pre_up;
docker-compose pull --parallel;
docker-compose up -d --remove-orphans;
;;
create_htaccess)
${ROOT}/bin/dev ssh "cp ${LOCAL_CORE_PATH}/bin/scripts/wp-cli.yml ${RELATIVE_DOCUMENT_ROOT}/ && cd ${RELATIVE_DOCUMENT_ROOT} && wp rewrite flush --hard"
;;
......@@ -239,9 +264,11 @@ wp config set WP_HOME $SITE_URL";
# spin down docker containers
stop | down)
echo "Stopping containers for ${PROJECT_NAME}...";
if [ "${PROJECT_NAME}" = "ebi.ac.uk.training-beta.online.courses" ]; then
sh ${ROOT}/custom_scripts/convert_ms_local.sh 'down' || true
fi
docker-compose stop;
${ROOT}/bin/dev post_stop;
${ROOT}/bin/dev prune;
${ROOT}/bin/dev post_stop
;;
prune)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment