Skip to content

Instantly share code, notes, and snippets.

@daviddarke
Last active October 7, 2019 12:01
Show Gist options
  • Save daviddarke/e130ed45a8556b44c7a654eacf1be9c3 to your computer and use it in GitHub Desktop.
Save daviddarke/e130ed45a8556b44c7a654eacf1be9c3 to your computer and use it in GitHub Desktop.
echo "-> Getting rid of local SQL file"
mkdir data
rm -rf data/development.sql
touch data/development.sql
echo "-> Booting Docker"
docker-compose up --build -d
echo "-> Removing vendor folder"
rm -rf vendor
echo "-> Updating composer"
docker-compose exec php composer update
echo "-> Installing temporary WP"
docker-compose exec php wp core install --url=http://localhost --title='blank' --admin_user='wp' --admin_email='[email protected]' --allow-root
echo "-> Activating backup plugin"
docker-compose exec php wp plugin activate backups --allow-root
echo "-> Getting dev DB"
docker-compose exec php wp backups development_sql_sync --sync-direction=pull --allow-root
echo "-> Importing dev DB"
docker-compose exec php wp db import data/development.sql --allow-root
echo "-> Syncing media"
docker-compose exec php wp backups backup --allow-root
echo "-> Stopping and botting docker again"
docker-compose stop
docker-compose up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment