Guest User

Untitled

a guest
Mar 5th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. # for initial site deployment to staging server, excludes dev tools and build files
  2. # uses current directory as theme path and ssh alias
  3. firstpush() {
  4. current=${PWD##*/}
  5. cd ~/Sites/$current || return
  6.  
  7. # rsync the local database to staging site
  8. wp db export $current.sql
  9. rsync $current.sql $current-s:~/
  10.  
  11. wp @stage core download --path=www --skip-content
  12.  
  13. wp @stage config create --dbname="$1" --dbuser="$2" --dbpass="$3" --skip-check --extra-php <<PHP
  14. define( 'WP_DEBUG', false );
  15. define('SAVEQUERIES', false);
  16. define( 'DISALLOW_FILE_EDIT', true );
  17. define( 'WP_POST_REVISIONS', 5 );
  18. define( 'JETPACK_STAGING_MODE', true);
  19. PHP
  20.  
  21. wp @stage db import $current.sql
  22. wp @stage search-replace "$current.localhost" "$current.dmctest.com.au" --all-tables
  23.  
  24. rsync --exclude-from "rsync-exclude.txt" wp-content $current-s:~/www
  25.  
  26. # remove plugins that aren't needed
  27. wp @stage plugin deactivate debug-bar query-monitor acf-theme-code-pro wordpress-seo
  28. wp @stage plugin delete debug-bar query-monitor acf-theme-code-pro wordpress-seo
  29. # Discourage search engines from indexing this site
  30. wp @stage option update blog_public 0
  31. }
Add Comment
Please, Sign In to add comment