Last active
December 21, 2015 18:39
-
-
Save shawnachieve/787a1175b114bd76be45 to your computer and use it in GitHub Desktop.
A set of aliases for common vagrant commands.
This file contains hidden or 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
# Clone this script using: | |
# cd ~ | |
# git clone [email protected]:787a1175b114bd76be45.git .vagrant_aliases | |
# | |
# Add the following to your ~/.profile file: | |
# if [ -f ~/.vagrant_aliases/.vagrant_aliases ]; then | |
# source ~/.vagrant_aliases/.vagrant_aliases | |
# fi | |
# Custom Vagrant Aliases/Commands | |
alias vrsync='vagrant gatling-rsync-auto' | |
alias vrsb='vagrant rsync-back' | |
# cd to vagrant project folder. | |
# Ex: cdvp myproject | |
cdvp() { | |
PROJECT_NAME=${1} | |
cd ~/vagrant/projects/${PROJECT_NAME} | |
} | |
# Start up a vagrant instance from anywhere. | |
# If no project name is given, assumes you are in the project folder already. | |
# ex: vup myproject | |
# ex: vup | |
vup() { | |
if [ "$#" -eq 1 ]; then | |
PROJECT_NAME=${1} | |
cdvp $PROJECT_NAME | |
fi | |
vagrant up | |
} | |
# Shut down a vagrant instance from anywhere. | |
# If no project name is given, assumes you are in the project folder already. | |
# ex: vdown myproject | |
# ex: vdown | |
vdown() { | |
if [ "$#" -eq 1 ]; then | |
PROJECT_NAME=${1} | |
cdvp $PROJECT_NAME | |
fi | |
vagrant halt | |
} | |
# SSH into a vagrant instance from anywhere. | |
# If no project name is given, assumes you are in the project folder already. | |
# ex: vssh myproject | |
# ex: vssh | |
vssh() { | |
if [ "$#" -eq 1 ]; then | |
PROJECT_NAME=${1} | |
cdvp $PROJECT_NAME | |
fi | |
vagrant ssh | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment