Skip to content

Instantly share code, notes, and snippets.

@joeinnes
Last active March 25, 2018 09:21
Show Gist options
  • Save joeinnes/6da64d3a3d345b37e50f to your computer and use it in GitHub Desktop.
Save joeinnes/6da64d3a3d345b37e50f to your computer and use it in GitHub Desktop.
Wordpress deploy into ServerPilot app
#!/bin/bash
# Script to deploy Wordpress into a ServerPilot app.
# Call programmatically via ssh - ssh <serverpilot-username>@<serverpilot-host> "curl <script-url> | sh -s <app-name> <db-name> <db-user> <db-user-pw>"
# This will prompt for password unless the user is able to log in using keys
cd /srv/users/serverpilot/apps/$1/public
wget https://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
mv wordpress/* .
rm latest.tar.gz
rmdir wordpress
sed -e "s/database_name_here/$2/" \
-e "s/username_here/$3/" \
-e "s/password_here/$4/" \
<wp-config-sample.php >wp-config.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment