Code Monkey home page Code Monkey logo

vagrants's Introduction

Prerequisites

Install Vagrant

Obviously, you need to install Vagrant, which requires Ruby and VirtualBox.

Create a working directory and start your new environment

$ git clone git://github.com/JulienD/vagrant.git my-vagrant
$ cd my-vagrant
$ vagrant up

If you want to change the configuration of your box, edit the Vagrantfile file which collect all the settings of your new virtual machin.

Provisionning

If you want to automate the provisionning of your box, have a look on my puppet repositroy

Performing shell commands on your box from your host machine

This little shell script allows you to perform commands in the box from your host machine without having to connect via ssh to it. This command is really simple, if the first argument passed is not the name of a Vagrant command, the argument is considered as a command to be executed on the box through ssh.

How to install

Edit your .bash_profile located in your home directory and put the following code at the bottom.

In order to make this code working you have to:

  • rename PROJECT as you wish. This will be your command name, so try something useful and easy to remember.
  • define the path of your vagrant directory to tell to the script where is your project. Rename project_dir variable.

How to use it

  • project help
  • project up
  • project whoami
# Vagrant command
#
PROJECT () {
  # Absolute path of your vagrant box.
  project_dir=$HOME/src/vagrant/vagrant

  cd $project_dir
  if vagrant help | grep -q "$1"; then
    vagrant "$@";
  else
    vagrant ssh -c "$*";
  fi
  cd $OLDPWD
}

vagrants's People

Contributors

juliend avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.