Skip to content

Commit

Permalink
Revert changes to dev env, as they are not used anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed May 23, 2020
1 parent 1ed0d4c commit 25fbaf0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 73 deletions.
12 changes: 2 additions & 10 deletions bin/local-env/includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ dc() {
# Executes a WP CLI request in the CLI container.
##
wp() {
if [ "$GITHUB_ACTIONS" == "true" ]; then
dc exec -T -u xfs $CLI wp "$@"
else
dc exec -u xfs $CLI wp "$@"
fi
dc exec -u xfs $CLI wp "$@"
}

##
Expand All @@ -168,9 +164,5 @@ wp() {
# Executes the given command in the wordpress container.
##
container() {
if [ "$GITHUB_ACTIONS" == "true" ]; then
dc exec -T $CONTAINER "$@"
else
dc exec $CONTAINER "$@"
fi
dc exec $CONTAINER "$@"
}
6 changes: 4 additions & 2 deletions bin/local-env/install-composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ set -e
# Include useful functions
. "$(dirname "$0")/includes.sh"


# Change to the expected directory
cd "$(dirname "$0")/../.."

# Check if composer is installed
if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && ! command_exists "composer"; then
if [ "$TRAVIS" != "true" ] && ! command_exists "composer"; then
if ask "$(error_message "Composer isn't installed, would you like to download and install it automatically?")" Y; then
echo -en $(status_message "Installing Composer..." )
download "https://getcomposer.org/installer" | bash >/dev/null 2>&1
Expand All @@ -28,12 +29,13 @@ if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && ! command_exist
fi

# Check if the current Composer version is up to date.
if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && ! [[ "$(composer --version)" == "Composer version $COMPOSER_VERSION "* ]]; then
if [ "$TRAVIS" != "true" ] && ! [[ "$(composer --version)" == "Composer version $COMPOSER_VERSION "* ]]; then
echo -en $(status_message "Updating Composer..." )
composer self-update
echo ' done!'
fi


# Install/update packages
echo -e $(status_message "Installing and updating Composer packages..." )
composer install
10 changes: 5 additions & 5 deletions bin/local-env/install-node-nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi
cd "$(dirname "$0")/../.."

# Check if nvm is installed
if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && ! command_exists "nvm"; then
if [ "$TRAVIS" != "true" ] && ! command_exists "nvm"; then
if ask "$(error_message "NVM isn't installed, would you like to download and install it automatically?")" Y; then
# The .bash_profile file needs to exist for NVM to install
if [ ! -e ~/.bash_profile ]; then
Expand All @@ -46,7 +46,7 @@ if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && ! command_exist
fi

# Check if the current nvm version is up to date.
if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && [ $NVM_VERSION != "v$(nvm --version)" ]; then
if [ "$TRAVIS" != "true" ] && [ $NVM_VERSION != "v$(nvm --version)" ]; then
echo -en $(status_message "Updating NVM..." )
download "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" | bash >/dev/null 2>&1
echo ' done!'
Expand All @@ -58,14 +58,14 @@ if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && [ $NVM_VERSION
fi

# Check if the current node version is up to date.
if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && [ "$(nvm current)" != "$(nvm version-remote --lts)" ]; then
if [ "$TRAVIS" != "true" ] && [ "$(nvm current)" != "$(nvm version-remote --lts)" ]; then
echo -e $(warning_message "Node version does not match the latest long term support version. Please run this command to install and use it:" )
echo -e $(warning_message "$(action_format "nvm install")" )
echo -e $(warning_message "After that, re-run the setup script to continue." )
exit 1
fi

if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ]; then
if [ "$TRAVIS" != "true" ]; then
# Install/update packages
echo -e $(status_message "Installing and updating NPM packages..." )
npm install
Expand All @@ -75,7 +75,7 @@ if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ]; then
fi

# There was a bug in NPM that caused changes in package-lock.json. Handle that.
if [ "$TRAVIS" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ] && ! git diff --no-ext-diff --exit-code package-lock.json >/dev/null; then
if [ "$TRAVIS" != "true" ] && ! git diff --no-ext-diff --exit-code package-lock.json >/dev/null; then
if ask "$(warning_message "Your package-lock.json changed, which may mean there's an issue with your NPM cache. Would you like to try and automatically clean it up?" )" N 10; then
rm -rf node_modules/
npm cache clean --force >/dev/null 2>&1
Expand Down
11 changes: 2 additions & 9 deletions bin/local-env/install-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,13 @@ echo -e $(status_message "Contributor created! Username: contributor Password: p
wp user create subscriber [email protected] --role=subscriber --user_pass=password --quiet
echo -e $(status_message "Subscriber created! Username: subscriber Password: password")

# Make sure the required folders exist and we have permissions to add files.
# Make sure the uploads and upgrade folders exist and we have permissions to add files.
echo -e $(status_message "Ensuring that files can be uploaded...")
container mkdir -p \
/var/www/html/wp-content/mu-plugins \
/var/www/html/wp-content/plugins \
/var/www/html/wp-content/uploads \
/var/www/html/wp-content/upgrade
container chmod 767 \
/var/www/html/wp-content \
/var/www/html/wp-content/mu-plugins \
/var/www/html/wp-content/plugins \
/var/www/html/wp-config.php \
/var/www/html/wp-settings.php \
Expand Down Expand Up @@ -98,13 +95,9 @@ container chmod 767 /var/www/html/favicon.ico
echo -e $(status_message "Activating AMP plugin...")
wp plugin activate amp --quiet

# Install & activate Gutenberg plugin.
echo -e $(status_message "Installing and activating PWA plugin...")
wp plugin install pwa --activate --force --quiet

# Install & activate Gutenberg plugin.
echo -e $(status_message "Installing and activating Gutenberg plugin...")
wp plugin install gutenberg --activate --force --quiet
wp plugin install gutenberg --activate --force --quiet --version=7.1.0

# Set pretty permalinks.
echo -e $(status_message "Setting permalink structure...")
Expand Down
47 changes: 0 additions & 47 deletions bin/local-env/populate-site.sh

This file was deleted.

0 comments on commit 25fbaf0

Please sign in to comment.