Last active
November 1, 2015 03:46
-
-
Save sethta/27feff8d839b1bf57761 to your computer and use it in GitHub Desktop.
Command Line Deployment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host alias1 | |
User user | |
Port 22 | |
Hostname host.domain.com | |
Host alias2 | |
User user | |
Port 22 | |
Hostname host.domain.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
akismet | |
crop-thumbnails | |
no-page-comment | |
wordpress-seo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment