Skip to content

Commit

Permalink
Update workflow. Remove verbose to speed up deploy
Browse files Browse the repository at this point in the history
aaronware authored Mar 24, 2022
1 parent 07a5208 commit 50eece4
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .deployment/wpengine-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -13,6 +13,13 @@ export RELEASES_DIR="$(dirname "$RELEASE_DIR")"
export PRIVATE_DIR="$(dirname "$RELEASES_DIR")"
export PUBLIC_DIR="$(dirname "$PRIVATE_DIR")"

cd "$PUBLIC_DIR"

# Start maintenance mode

wget -O maintenance.php https://raw.githubusercontent.com/linchpin/actions/main/maintenance.php
wp maintenance-mode activate

# Make all the bash scripts executable.
chmod +x *.sh

@@ -21,8 +28,8 @@ wp db export --path="$PUBLIC_DIR" - | gzip > "$RELEASES_DIR/db_backup.sql.gz"
cd "$RELEASE_DIR"

# rsync latest release to public folder.
rsync -vrxc --delete ${RELEASE_DIR}/plugins/. ${PUBLIC_DIR}/wp-content/plugins
rsync -vrxc --delete ${RELEASE_DIR}/themes/. ${PUBLIC_DIR}/wp-content/themes
rsync -arxc --delete ${RELEASE_DIR}/plugins/. ${PUBLIC_DIR}/wp-content/plugins
rsync -arxc --delete ${RELEASE_DIR}/themes/. ${PUBLIC_DIR}/wp-content/themes

# Only sync MU Plugins if we have them
if [ -d "${RELEASE_DIR}/mu-plugins/" ] ; then
@@ -32,7 +39,7 @@ if [ -d "${RELEASE_DIR}/mu-plugins/" ] ; then
wget -O .distignore https://raw.githubusercontent.com/linchpin/actions/main/default.distignore
fi;

rsync -vrxc --delete --exclude-from=".distignore" ${RELEASE_DIR}/mu-plugins/. ${PUBLIC_DIR}/wp-content/mu-plugins
rsync -arxc --delete --exclude-from=".distignore" ${RELEASE_DIR}/mu-plugins/. ${PUBLIC_DIR}/wp-content/mu-plugins
fi

# Final cleanup: Only keep the latest release zip
@@ -44,3 +51,10 @@ rm `ls -t *.zip | awk 'NR>2'`

echo "Delete all old release folders"
find -maxdepth 1 ! -name "release" ! -name . -exec rm -rv {} \;

cd "$PUBLIC_DIR"

# End maintenance mode, reset

rm maintenance.php
wp maintenance-mode deactivate

0 comments on commit 50eece4

Please sign in to comment.