-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Wagner
committed
Oct 11, 2023
1 parent
36db229
commit 8c1e0fa
Showing
5 changed files
with
29 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,58 +27,58 @@ set -ex | |
### | ||
# Create a new environment for this particular test run. | ||
### | ||
terminus env:create $TERMINUS_SITE.dev $TERMINUS_ENV | ||
terminus env:wipe $SITE_ENV --yes | ||
terminus env:create "$TERMINUS_SITE".dev "$TERMINUS_ENV" | ||
terminus env:wipe "$SITE_ENV" --yes | ||
|
||
### | ||
# Get all necessary environment details. | ||
### | ||
PANTHEON_GIT_URL=$(terminus connection:info $SITE_ENV --field=git_url) | ||
PANTHEON_GIT_URL=$(terminus connection:info "$SITE_ENV" --field=git_url) | ||
PANTHEON_SITE_URL="$TERMINUS_ENV-$TERMINUS_SITE.pantheonsite.io" | ||
PREPARE_DIR="/tmp/$TERMINUS_ENV-$TERMINUS_SITE" | ||
BASH_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
### | ||
# Switch to git mode for pushing the files up | ||
### | ||
terminus connection:set $SITE_ENV git | ||
rm -rf $PREPARE_DIR | ||
git clone -b $TERMINUS_ENV $PANTHEON_GIT_URL $PREPARE_DIR | ||
terminus connection:set "$SITE_ENV" git | ||
rm -rf "$PREPARE_DIR" | ||
git clone -b "$TERMINUS_ENV" "$PANTHEON_GIT_URL" "$PREPARE_DIR" | ||
|
||
### | ||
# Add the copy of this plugin itself to the environment | ||
### | ||
rm -rf $PREPARE_DIR/wp-content/plugins/wp-native-php-sessions | ||
cd $BASH_DIR/.. | ||
rsync -av --exclude='vendor/' --exclude='node_modules/' --exclude='tests/' ./* $PREPARE_DIR/wp-content/plugins/wp-native-php-sessions | ||
rm -rf $PREPARE_DIR/wp-content/plugins/wp-native-php-sessions/.git | ||
rm -rf "$PREPARE_DIR"/wp-content/plugins/wp-native-php-sessions | ||
cd "$BASH_DIR"/.. | ||
rsync -av --exclude='vendor/' --exclude='node_modules/' --exclude='tests/' ./* "$PREPARE_DIR"/wp-content/plugins/wp-native-php-sessions | ||
rm -rf "$PREPARE_DIR"/wp-content/plugins/wp-native-php-sessions/.git | ||
|
||
### | ||
# Add the debugging plugin to the environment | ||
### | ||
rm -rf $PREPARE_DIR/wp-content/mu-plugins/sessions-debug.php | ||
cp $BASH_DIR/fixtures/sessions-debug.php $PREPARE_DIR/wp-content/mu-plugins/sessions-debug.php | ||
rm -rf "$PREPARE_DIR"/wp-content/mu-plugins/sessions-debug.php | ||
cp "$BASH_DIR"/fixtures/sessions-debug.php "$PREPARE_DIR"/wp-content/mu-plugins/sessions-debug.php | ||
|
||
### | ||
# Push files to the environment | ||
### | ||
cd $PREPARE_DIR | ||
cd "$PREPARE_DIR" | ||
git add wp-content | ||
git config user.email "[email protected]" | ||
git config user.name "Pantheon" | ||
git commit -m "Include WP Native PHP Sessions and its configuration files" | ||
git push | ||
|
||
# Sometimes Pantheon takes a little time to refresh the filesystem | ||
terminus build:workflow:wait $TERMINUS_SITE.$TERMINUS_ENV | ||
terminus build:workflow:wait "$TERMINUS_SITE"."$TERMINUS_ENV" | ||
|
||
### | ||
# Set up WordPress, theme, and plugins for the test run | ||
### | ||
# Silence output so as not to show the password. | ||
{ | ||
terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME [email protected] --admin_password=$WORDPRESS_ADMIN_PASSWORD | ||
terminus wp "$SITE_ENV" -- core install --title="$TERMINUS_ENV"-"$TERMINUS_SITE" --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME [email protected] --admin_password="$WORDPRESS_ADMIN_PASSWORD" | ||
} &> /dev/null | ||
terminus wp $SITE_ENV -- plugin activate wp-native-php-sessions | ||
terminus wp $SITE_ENV -- theme activate twentytwentythree | ||
terminus wp $SITE_ENV -- rewrite structure '/%year%/%monthnum%/%day%/%postname%/' | ||
terminus wp "$SITE_ENV" -- plugin activate wp-native-php-sessions | ||
terminus wp "$SITE_ENV" -- theme activate twentytwentythree | ||
terminus wp "$SITE_ENV" -- rewrite structure '/%year%/%monthnum%/%day%/%postname%/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters