Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # for initial site deployment to staging server, excludes dev tools and build files
- # uses current directory as theme path and ssh alias
- firstpush() {
- current=${PWD##*/}
- cd ~/Sites/$current || return
- # rsync the local database to staging site
- wp db export $current.sql
- rsync $current.sql $current-s:~/
- wp @stage core download --path=www --skip-content
- wp @stage config create --dbname="$1" --dbuser="$2" --dbpass="$3" --skip-check --extra-php <<PHP
- define( 'WP_DEBUG', false );
- define('SAVEQUERIES', false);
- define( 'DISALLOW_FILE_EDIT', true );
- define( 'WP_POST_REVISIONS', 5 );
- define( 'JETPACK_STAGING_MODE', true);
- PHP
- wp @stage db import $current.sql
- wp @stage search-replace "$current.localhost" "$current.dmctest.com.au" --all-tables
- rsync --exclude-from "rsync-exclude.txt" wp-content $current-s:~/www
- # remove plugins that aren't needed
- wp @stage plugin deactivate debug-bar query-monitor acf-theme-code-pro wordpress-seo
- wp @stage plugin delete debug-bar query-monitor acf-theme-code-pro wordpress-seo
- # Discourage search engines from indexing this site
- wp @stage option update blog_public 0
- }
Add Comment
Please, Sign In to add comment