Commit 86cb8e1a authored by Sandeep Kadam's avatar Sandeep Kadam

Updated new VF template changes in local deployment script

parent a0063d39
......@@ -98,41 +98,41 @@ wp plugin install user-role-editor --activate
# Define postcontent of vf_template.
case "$site_theme" in
EMBL)
vf_template_content="
<!-- wp:vf/container-global-header /-->
vf_template_content='
<!-- wp:acf/vf-container-global-header {"id":"block_5ebb9edff871c","name":"acf/vf-container-global-header"} /-->
<!-- wp:vf/container-breadcrumbs /-->
<!-- wp:acf/vf-container-breadcrumbs {"id":"block_5ebb9fd224009","name":"acf/vf-container-breadcrumbs"} /-->
<!-- wp:vf/container-wp-groups-header /-->
<!-- wp:acf/vf-container-wp-groups-header {"id":"block_5ebb9fe02400a","name":"acf/vf-container-wp-groups-header"} /-->
<!-- wp:vf/container-page-template /-->
<!-- wp:acf/vf-container-page-template {"id":"block_5ebb9edff871d","name":"acf/vf-container-page-template"} /-->
<!-- wp:vf/container-embl-news /-->
<!-- wp:acf/vf-container-embl-news {"id":"block_5ebb9fef2400b","name":"acf/vf-container-embl-news"} /-->
<!-- wp:vf/container-global-footer /-->";
<!-- wp:acf/vf-container-global-footer {"id":"block_5ebb9edff871e","name":"acf/vf-container-global-footer"} /-->';
;;
EBI-SERVICE|EBI-CLUSTERS|EBI-RESEARCH)
vf_template_content="
<!-- wp:vf/container-ebi-global-header /-->
vf_template_content='
<!-- wp:acf/vf-container-ebi-global-header {"id":"block_5ebba0902400e","name":"acf/vf-container-ebi-global-header"} /-->
<!-- wp:vf/container-breadcrumbs /-->
<!-- wp:acf/vf-container-breadcrumbs {"id":"block_5ebb9fd224009","name":"acf/vf-container-breadcrumbs"} /-->
<!-- wp:vf/container-wp-groups-header /-->
<!-- wp:acf/vf-container-wp-groups-header {"id":"block_5ebb9fe02400a","name":"acf/vf-container-wp-groups-header"} /-->
<!-- wp:vf/container-page-template /-->
<!-- wp:acf/vf-container-page-template {"id":"block_5ebb9edff871d","name":"acf/vf-container-page-template"} /-->
<!-- wp:vf/container-embl-news /-->
<!-- wp:acf/vf-container-embl-news {"id":"block_5ebb9fef2400b","name":"acf/vf-container-embl-news"} /-->
<!-- wp:vf/container-ebi-global-footer /-->";
<!-- wp:acf/vf-container-ebi-global-footer {"id":"block_5ebba0942400f","name":"acf/vf-container-ebi-global-footer"} /-->';
;;
*)
# Default content
vf_template_content="
<!-- wp:vf/container-global-header /-->
vf_template_content='
<!-- wp:acf/vf-container-global-header {"id":"block_5ebb9edff871c","name":"acf/vf-container-global-header"} /-->
<!-- wp:vf/container-page-template /-->
<!-- wp:acf/vf-container-page-template {"id":"block_5ebb9edff871d","name":"acf/vf-container-page-template"} /-->
<!-- wp:vf/container-global-footer /-->";
<!-- wp:acf/vf-container-global-footer {"id":"block_5ebb9edff871e","name":"acf/vf-container-global-footer"} /-->';
;;
esac;
......@@ -279,12 +279,14 @@ echo "Homepage - configuring"
TEAM_LONG_DESCRIPTION="<h1>${WP_GROUP_TEAM_SHORT_DESCRIPTION} <a href='about'>Read more<\/a>.<\/h1>"
# Set the Gutenberg HTML content for the homepage
IFS='' read -r home_page_content <<EOF
<!-- wp:vf/group-header {"ver":1} /-->
<!-- wp:acf/vfwp-latest-posts {"id":"block_5ea826258cfbb","name":"acf/vfwp-latest-posts"} /-->
<!-- wp:vf/data-resources {"ver":1} /-->
<!-- wp:vf/jobs {"limit":1,"filter":"all","ver":1} /-->
EOF
home_page_content='
<!-- wp:acf/vf-group-header {"id":"block_5ebba207a5cce","name":"acf/vf-group-header","data":{"field_defaults":"1"},"mode":"preview"} /-->
<!-- wp:acf/vfwp-latest-posts {"id":"block_5ebba351a5cd0","name":"acf/vfwp-latest-posts","data":{"field_5e99679631cbd":"","field_5e9967a331cbe":""},"mode":"preview"} /-->
<!-- wp:acf/vf-data-resources {"id":"block_5ebba324a5ccf","name":"acf/vf-data-resources","data":{"field_defaults":"1"},"mode":"preview"} /-->
<!-- wp:acf/vf-jobs {"id":"block_5ebba1baa5ccb","name":"acf/vf-jobs","data":{"field_defaults":"0","field_vf_jobs_heading":"","field_vf_jobs_limit":"1","field_vf_jobs_filter":"all"},"mode":"preview"} /-->';
# Find ID of homepage and update contents
home_page_id=$(wp option get page_on_front)
......@@ -294,10 +296,8 @@ wp post update $home_page_id --post_content="$home_page_content"
echo "=== Members, about and blog ==="
if ! [[ `wp post list --post_type=page --name=members --field=ID` ]] ; then
echo "Members, about and blog - Configuring"
# Set the Gutenberg HTML content for the members page
IFS='' read -r members_page_content <<EOF
<!-- wp:vf/members {"ver":1} /-->
EOF
# Set the Gutenberg HTML content for the members page
members_page_content='<!-- wp:acf/vf-members {"id":"block_5ebba3effc3ea","name":"acf/vf-members","data":{"field_defaults":"1"},"mode":"preview"} /-->';
team_page_id="$(wp post create --post_title='Members' --post_type=page --post_status=publish --post_content="$members_page_content" --porcelain)"
wp post meta update $team_page_id _wp_page_template template-members.php
......
......@@ -230,41 +230,41 @@ wp option update blogdescription $SITE_TAGLINE
# Define postcontent of vf_template.
case "$site_theme" in
EMBL)
vf_template_content="
<!-- wp:vf/container-global-header /-->
vf_template_content='
<!-- wp:acf/vf-container-global-header {"id":"block_5ebb9edff871c","name":"acf/vf-container-global-header"} /-->
<!-- wp:vf/container-breadcrumbs /-->
<!-- wp:acf/vf-container-breadcrumbs {"id":"block_5ebb9fd224009","name":"acf/vf-container-breadcrumbs"} /-->
<!-- wp:vf/container-wp-groups-header /-->
<!-- wp:acf/vf-container-wp-groups-header {"id":"block_5ebb9fe02400a","name":"acf/vf-container-wp-groups-header"} /-->
<!-- wp:vf/container-page-template /-->
<!-- wp:acf/vf-container-page-template {"id":"block_5ebb9edff871d","name":"acf/vf-container-page-template"} /-->
<!-- wp:vf/container-embl-news /-->
<!-- wp:acf/vf-container-embl-news {"id":"block_5ebb9fef2400b","name":"acf/vf-container-embl-news"} /-->
<!-- wp:vf/container-global-footer /-->";
<!-- wp:acf/vf-container-global-footer {"id":"block_5ebb9edff871e","name":"acf/vf-container-global-footer"} /-->';
;;
EBI-SERVICE|EBI-CLUSTERS|EBI-RESEARCH)
vf_template_content="
<!-- wp:vf/container-ebi-global-header /-->
vf_template_content='
<!-- wp:acf/vf-container-ebi-global-header {"id":"block_5ebba0902400e","name":"acf/vf-container-ebi-global-header"} /-->
<!-- wp:vf/container-breadcrumbs /-->
<!-- wp:acf/vf-container-breadcrumbs {"id":"block_5ebb9fd224009","name":"acf/vf-container-breadcrumbs"} /-->
<!-- wp:vf/container-wp-groups-header /-->
<!-- wp:acf/vf-container-wp-groups-header {"id":"block_5ebb9fe02400a","name":"acf/vf-container-wp-groups-header"} /-->
<!-- wp:vf/container-page-template /-->
<!-- wp:acf/vf-container-page-template {"id":"block_5ebb9edff871d","name":"acf/vf-container-page-template"} /-->
<!-- wp:vf/container-embl-news /-->
<!-- wp:acf/vf-container-embl-news {"id":"block_5ebb9fef2400b","name":"acf/vf-container-embl-news"} /-->
<!-- wp:vf/container-ebi-global-footer /-->";
<!-- wp:acf/vf-container-ebi-global-footer {"id":"block_5ebba0942400f","name":"acf/vf-container-ebi-global-footer"} /-->';
;;
*)
# Default content
vf_template_content="
<!-- wp:vf/container-global-header /-->
vf_template_content='
<!-- wp:acf/vf-container-global-header {"id":"block_5ebb9edff871c","name":"acf/vf-container-global-header"} /-->
<!-- wp:vf/container-page-template /-->
<!-- wp:acf/vf-container-page-template {"id":"block_5ebb9edff871d","name":"acf/vf-container-page-template"} /-->
<!-- wp:vf/container-global-footer /-->";
<!-- wp:acf/vf-container-global-footer {"id":"block_5ebb9edff871e","name":"acf/vf-container-global-footer"} /-->';
;;
esac;
......@@ -395,12 +395,15 @@ case "${COMMAND}" in
echo "Homepage - configuring"
# Configure the homepage
# Set the Gutenberg HTML content for the homepage of microsite
home_page_content=$(cat <<EOF
<!-- wp:vf/group-header {"ver":1} /-->
<!-- wp:acf/vfwp-latest-posts {"id":"block_5ea826258cfbb","name":"acf/vfwp-latest-posts"} /-->
<!-- wp:vf/data-resources {"ver":1} /-->
<!-- wp:vf/jobs {"limit":1,"filter":"all","ver":1} /-->
EOF);
home_page_content='
<!-- wp:acf/vf-group-header {"id":"block_5ebba207a5cce","name":"acf/vf-group-header","data":{"field_defaults":"1"},"mode":"preview"} /-->
<!-- wp:acf/vfwp-latest-posts {"id":"block_5ebba351a5cd0","name":"acf/vfwp-latest-posts","data":{"field_5e99679631cbd":"","field_5e9967a331cbe":""},"mode":"preview"} /-->
<!-- wp:acf/vf-data-resources {"id":"block_5ebba324a5ccf","name":"acf/vf-data-resources","data":{"field_defaults":"1"},"mode":"preview"} /-->
<!-- wp:acf/vf-jobs {"id":"block_5ebba1baa5ccb","name":"acf/vf-jobs","data":{"field_defaults":"0","field_vf_jobs_heading":"","field_vf_jobs_limit":"1","field_vf_jobs_filter":"all"},"mode":"preview"} /-->';
# Find ID of homepage and update contents
home_page_id=$(wp option get page_on_front)
......@@ -418,9 +421,7 @@ EOF);
# Create Members page - Create only if it doesn't exists.
if ! $(wp post list --post_type=page --fields=post_title --format=csv | grep -qE "^Members"); then
# Set the Gutenberg HTML content for the members page
IFS='' read -r members_page_content <<EOF
<!-- wp:vf/members {"ver":1} /-->
EOF
members_page_content='<!-- wp:acf/vf-members {"id":"block_5ebba3effc3ea","name":"acf/vf-members","data":{"field_defaults":"1"},"mode":"preview"} /-->';
team_page_id="$(wp post create --post_title='Members' --post_type=page --post_status=publish --post_content="$members_page_content" --porcelain)"
wp menu item add-post primary $team_page_id --title="Members"
wp post meta update $team_page_id _wp_page_template template-members.php
......@@ -513,9 +514,6 @@ esac;
# Flush the rewrite cache from DB
wp rewrite flush
# Disable caching for testing downtime
#wp option set options_vf_cache_disabled 1
# Additional tasks only for microsites.
if [ "$MICROSITE_FLAG" -eq "1" ] ; then
......@@ -530,11 +528,16 @@ if [ "$MICROSITE_FLAG" -eq "1" ] ; then
# Apply SAML config & other additional configs
PHP=`which php`;
# Apply SAML Unique entity config -Don't apply for dummy sites
if [[ "$MICROSITE_FOLDER_NAME" != *dummy-* ]] ; then
wp option set onelogin_saml_advanced_settings_sp_entity_id "${ENVIRONMENT}.$MICROSITE_FOLDER_NAME"
# Apply SAML Unique entity config - Don't apply for dummy sites
if [[ "$MICROSITE_FOLDER_NAME" = *dummy-* ]] ; then
# Disable caching for testing downtime
wp option set options_vf_cache_disabled 1
else
wp option set onelogin_saml_advanced_settings_sp_entity_id "${ENVIRONMENT}.$MICROSITE_FOLDER_NAME"
$PHP -f ${MICROSITE_PATH}/bin/scripts/wp_vf_custom_code.php -- ${DEPLOY_PATH} ${ENVIRONMENT}
fi
# Close/delete comments & pingbacks
wp comment delete 1 --force || true
wp db query "DELETE FROM wp_comments WHERE comment_approved != 1;";
......
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