Commit a66c1175 authored by Sandeep Kadam's avatar Sandeep Kadam

Updated .env template file & deploy script update for multi datacenter file sync

parent 92d3ab87
......@@ -29,9 +29,9 @@ set -a; source ${ROOT}/.env; set +a;
# check which environment to deploy to
case "${ENVIRONMENT:-invalid}" in
dev) SERVER="${DEV_SERVER}"; WP_SITE_URL="${DEV_SITE_URL}"; ;;
stage) SERVER="${STAGE_SERVER}"; WP_SITE_URL="${STAGE_SITE_URL}"; ;;
prod) SERVER="${PROD_SERVER}"; WP_SITE_URL="${PROD_SITE_URL}"; ;;
dev) SERVER="${DEV_SERVER}"; WP_SITE_URL="${DEV_SITE_URL}"; MASTER_SERVER="${DEV_SERVER%% *}"; ;;
stage) SERVER="${STAGE_SERVER}"; WP_SITE_URL="${STAGE_SITE_URL}"; MASTER_SERVER="${STAGE_SERVER%% *}"; ;;
prod) SERVER="${PROD_SERVER}"; WP_SITE_URL="${PROD_SITE_URL}"; MASTER_SERVER="${PROD_SERVER%% *}"; ;;
*) SERVER="" && usage ;;
esac;
......@@ -110,5 +110,14 @@ do
ssh -tt ${SSH_APACHE}@${_SERVER} 'sudo /etc/init.d/httpd status && sudo /etc/init.d/memcached status && sudo /etc/init.d/rh-php56-php-fpm status' ||
ssh -tt ${SSH_APACHE}@${_SERVER} 'sleep 5 && sudo /etc/init.d/httpd status && sudo /etc/init.d/memcached status && sudo /etc/init.d/rh-php56-php-fpm status';
fi;
# Changes to be executed only once & on one server
if [ "$_SERVER" = "$MASTER_SERVER" ]; then
#copy settings, conf, cron, bin folders to nfs in HH datacentre
ssh ${SSH_OWNER}@ebi-cli '/nfs/public/rw/webdevel/projects/drupal/bin/rsync_dir_datacentres_owner';
#copy files, tmp folders to nfs in HH datacentre
ssh ${SSH_APACHE}@ebi-cli '/nfs/public/rw/webdevel/projects/drupal/bin/rsync_dir_datacentres_user';
fi
done;
# Configuration file for Wordpress local development and deployment script
# Configuration file for Wordpress development and deployment script
# Copy this file to the root of the repo, edit the configuration in steps 1-4 and rename to .env
#
# 1. define the name of the Wordpress site
# 1. define the name of the wordpress site, using the standard wordpress pattern (subdomain.domain.directory)
#
PROJECT_NAME=wordpresslocal
# Wordpress specific details
DEV_SITE_URL=https://dev.${PROJECT_NAME}
STAGE_SITE_URL=http://stage.${PROJECT_NAME}
PROD_SITE_URL=http://${PROJECT_NAME}
#
# 2. define the layout of the deployment
#
# DEPLOY_SITE_NAME should be one of ${PROJECT_NAME} (multi-site) or default
#
# Site will be deployed on VM and in docker container at
# ${VM_CORE_PATH}/sites/${DEPLOY_SITE_NAME}
#
DEPLOY_SITE_NAME=${PROJECT_NAME}
DEPLOY_INSTANCE=ebi8
VM_CORE_PATH=/var/www/drupal/${PROJECT_NAME}
# Local docker path
APACHE_DOCUMENT_ROOT=/var/www/html/dist
#
# 3. list server names for deployment
#
# multiple servers can be specified for load balanced services
#
DEV_SERVER="wp-np2-10"
STAGE_SERVER="wp-np2-11"
PROD_SERVER="wp-p2m-12 wp-p2m-13 wp-p1m-12 wp-p1m-13"
#
# 4. list ssh usernames for deployment, keys should be in ~/.ssh
#
SSH_OWNER=wd_drupl
SSH_APACHE=w3_wd01
# WP basic configuration defaults
WP_SITE_ADMIN_EMAIL="sandeep@ebi.ac.uk"
WP_SITE_TITLE="Wordpress demo site"
WP_SITE_DESCRIPTION="This is my WP Demo Site Description"
WP_SITE_ADMIN_USERNAME="admin"
WP_SITE_ADMIN_PASSWORD="admin"
WP_SITE_ADMIN_EMAIL="admin@mysite.com"
# WP default plugins/posts/comments config changes
WP_NEED_BLANK_SITE=No
......@@ -33,18 +65,19 @@ THEME_FOOTER="vf_ebi_global_footer"
### End of optional settings/values ###
##############################################
# you shouldn't need to edit below this line #
# you shouldn't need to edit below this line
VM_CORE_PATH=/var/www/html
APACHE_DOCUMENT_ROOT=/var/www/html/dist
# Required all below config for repo specific paths for local development & folder creation for site setup
# repo specific paths
LOCAL_CORE_PATH=.
RELATIVE_DOCUMENT_ROOT=dist
RELATIVE_FILES_SRC=_files
RELATIVE_SETTINGS_SRC=_settings
RELATIVE_SQLDUMP_SRC=_sqldump
RELATIVE_SQLDATA_SRC=_sqldata
RELATIVE_TEMP_SRC=_temp
# will get symlink'd to ${RELATIVE_FILES_SRC}, make sure the number of / match
USER_FILES=${RELATIVE_DOCUMENT_ROOT}/wp-content/uploads
USER_FILES_SYMLINK=../../${RELATIVE_FILES_SRC}
WP_SETTINGS_PHP=${RELATIVE_DOCUMENT_ROOT}/wp-config.php
......@@ -56,15 +89,17 @@ WP_SOURCE_PLUGIN_PATH=${LOCAL_CORE_PATH}/wp-content/plugins
WP_DEST_THEMES_PATH=${RELATIVE_DOCUMENT_ROOT}/wp-content/themes
WP_DEST_PLUGIN_PATH=${RELATIVE_DOCUMENT_ROOT}/wp-content/plugins
# locations on NFS
NFS_FILES_SRC=/nfs/public/rw/webdevel/projects/drupal/files/${ENVIRONMENT}/${DEPLOY_INSTANCE}/${PROJECT_NAME}/public
NFS_WP_SETTINGS_SRC=/nfs/public/rw/webdevel/projects/drupal/settings.php.d/${ENVIRONMENT}/${DEPLOY_INSTANCE}/${PROJECT_NAME}/wp-config.php
NFS_SQLDUMP_SRC=/nfs/public/rw/webdevel/projects/drupal/dump.sql.d/${ENVIRONMENT}/${DEPLOY_INSTANCE}/${PROJECT_NAME}
NFS_TEMP_SRC=/nfs/public/rw/webdevel/projects/drupal/tmp/${ENVIRONMENT}/${DEPLOY_INSTANCE}/${PROJECT_NAME}
# docker specific details, used in docker-compose.yml for local development
PHP_TAG=7.1-dev-4.4.5
MARIADB_TAG=10.1-3.2.2
APACHE_TAG=2.4-3.0.5
DOCKER_DATABASE=docker
DOCKER_DATABASE_USER=docker
DOCKER_DATABASE_PASS=docker
DB_ROOT_PASSWORD=rootpassword
GIT_EMBL_DE_TOKEN=tHJezuyyt53veqK-MSs6
### PROJECT SETTINGS
PHP_TAG=7.1-dev-4.4.5
MARIADB_TAG=10.1-3.2.2
APACHE_TAG=2.4-3.0.5
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