Skip to content

Instantly share code, notes, and snippets.

@mobyjames
Last active June 2, 2016 16:21
Show Gist options
  • Save mobyjames/1bfa4f8709529f5f28e1d2569f23661c to your computer and use it in GitHub Desktop.
Save mobyjames/1bfa4f8709529f5f28e1d2569f23661c to your computer and use it in GitHub Desktop.
How to Vagrant at Moby

#Moby Vagrant Instructions

###One-time Workstation Setup

  • Open terminal and run the follwing commands
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew cask install virtualbox
$ brew cask install vagrant
$ brew cask install vagrant-manager
$ vagrant plugin install vagrant-bindfs
$ vagrant plugin install vagrant-hostmanager
$ vagrant plugin install vagrant-aws
$ vagrant plugin install vagrant-aws-route53
  • Obtain Vagrant ssh key and credential files from James and copy them to to ~/.ssh/
  • There is small chance you may have to add the following line to your ~/.bash_profile : ulimit -n 1024

###Project Setup

  • Checkout project from Git to your local machine (wherever you want)
  • Open terminal in project folder
  • Decide if you want a local environment or one in the cloud

Local

  • $ vagrant up
  • Open project-specific local url in browser (see readme)
  • Normal edit / gulp / git flow from here

Cloud

  • Decide on a name for the cloud VM which will also become its bymoby.com subdomain. The name must be unique and follow url naming conventions.
    • Consider using initials-project e.g. jj-craftplugins
  • $ PROVIDER=aws NAME=YourChosenName vangrant up
  • Open your VM's url in a browser. The url will be YourChosenName.bymoby.com
  • Normal edit / gulp / git flow from here

###Working from non-desktop devices

  • Establish a Cloud VM following the instructions above
  • Use the Vagrant SSH key to SSH / SFTP to the VM
  • Use any browsers to access the whatever.bymoby.com url
  • Edit files on the server via SFTP or SSH
  • Run gulp commands on the server via SSH
  • Use your desktop to perform git operations

###Helpful commands

vagrant status
vagrant ssh
vagrant rsync
vagrant destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment