Skip to content

Instantly share code, notes, and snippets.

@sethta
Last active November 1, 2015 03:46
Show Gist options
  • Save sethta/27feff8d839b1bf57761 to your computer and use it in GitHub Desktop.
Save sethta/27feff8d839b1bf57761 to your computer and use it in GitHub Desktop.
Command Line Deployment
# Git Aliases
alias gi='git init'
alias gs='git status'
alias ga='git add -A'
alias gc='git commit . -m'
alias gpull='git pull origin master'
alias gpush='git push origin master'
alias gt='git tag'
alias gtag='git push --tags'
# Svn Aliases
alias ss='svn stat'
alias sa='svn add * --force'
alias sc='svn ci -m'
# Vagrant Aliases
alias vs='vagrant status'
alias vu='vagrant up'
alias vup='vagrant up --provision'
alias vh='vagrant halt'
# RHD Deploy Functions (cPanel Server)
rhdgit () {
if [ "$1" ]; then
USER=$1
else
read -p "Enter site username : " USER
fi
ssh -l rhd ${USER} git pull origin master
}
rhddb () {
if [ "$1" ]; then
DOMAIN=$1
else
read -p "Enter domain : " DOMAIN
fi
if [ "$2" ]; then
DBPROFILE=$2
else
read -p "Enter DB profile number : " DBPROFILE
fi
vagrant ssh -c "cd /vagrant/www/${DOMAIN}/public_html; wp migratedb profile ${DBPROFILE}"
}
rhdg () {
if [ "$1" ]; then
HOST=$1
else
read -p "Enter host : " HOST
fi
gpush
rhdgit ${HOST}
if [ "$2" ]; then
DOMAIN=$2
if [ "$3" ]; then
DBPROFILE=$3
else
read -p "Enter DB profile number : " DBPROFILE
fi
rhddb ${DOMAIN} ${DBPROFILE}
fi
}
# STA Deploy Functions (VPS)
stagit () {
if [ "$1" ]; then
HOST=$1
else
read -p "Enter host : " HOST
fi
ssh -l ${HOST} git pull origin master
}
stadb () {
if [ "$1" ]; then
DOMAIN=$1
else
read -p "Enter domain : " DOMAIN
fi
if [ "$2" ]; then
DBPROFILE=$2
else
read -p "Enter DB profile number : " DBPROFILE
fi
vagrant ssh -c "cd /vagrant/www/${DOMAIN}/htdocs; wp migratedb profile ${DBPROFILE}"
}
stag () {
if [ "$1" ]; then
HOST=$1
else
read -p "Enter host : " HOST
fi
gpush
stagit ${HOST}
if [ "$2" ]; then
DOMAIN=$2
if [ "$3" ]; then
DBPROFILE=$3
else
read -p "Enter DB profile number : " DBPROFILE
fi
stadb ${DOMAIN} ${DBPROFILE}
fi
}
Host alias1
User user
Port 22
Hostname host.domain.com
Host alias2
User user
Port 22
Hostname host.domain.com
#!/bin/bash
# Loop through repository plugins
while read PLUGIN
do
wp plugin install "$PLUGIN" --activate
done < plugins.txt
# Loop through premium plugins
while read PLUGIN
do
echo "$PLUGIN"
wget -O premium.zip "$PLUGIN"
wp plugin install premium.zip --activate
rm premium.zip
done < premium.txt
akismet
crop-thumbnails
no-page-comment
wordpress-seo
http://connect.advancedcustomfields.com/index.php?p=pro&a=download&k=<ACF_KEY_GOES_HERE>=
https://deliciousbrains.com/dl/wp-migrate-db-pro-latest.zip?licence_key=<WP_MIGRATE_DB_PRO_KEY_GOES_HERE>&site_url=<WEBSITE_URL_WITH_NO_HTTP>
https://deliciousbrains.com/dl/wp-migrate-db-pro-media-files-latest.zip?licence_key=<WP_MIGRATE_DB_PRO_KEY_GOES_HERE>&site_url=<WEBSITE_URL_WITH_NO_HTTP>
https://deliciousbrains.com/dl/wp-migrate-db-pro-cli-latest.zip?licence_key=<WP_MIGRATE_DB_PRO_KEY_GOES_HERE>&site_url=<WEBSITE_URL_WITH_NO_HTTP>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment