Last active
August 29, 2015 14:22
-
-
Save drnikki/60a98f8a4686975f74c4 to your computer and use it in GitHub Desktop.
svn2git vagrantfile
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
# taken directly from http://blogs.isostech.com/git/howto-use-vagrant-git-importing-sandbox/ | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
echo I am provisioning... | |
date > /etc/vagrant_provisioned_at | |
sudo apt-get -q -y install git-core git-svn ruby rubygems subversion | |
sudo gem install svn2git --source http://gemcutter.org | |
SCRIPT | |
Vagrant.configure("2") do |config| | |
# set the base box type | |
## Usage :: For a redhat/centos VM w/hostname jira.example.com: | |
### OPERATINGSYSTEM='redhat' vagrant up jira.example.com | |
## Usage :: For a precise64 VM w/hostname jira.example.com: | |
### vagrant up | |
os_name = 'precise64' | |
config.vm.box = 'precise64' | |
config.vm.box_url = 'http://files.vagrantup.com/precise64.box' | |
# set the hostname | |
if ("#{ARGV[1]}"=="") | |
ARGV[1]='migrate.example.com' | |
end | |
config.vm.hostname="#{ARGV[1]}" | |
config.vm.define :"#{ARGV[1]}" do |mmconfig| | |
#mmconfig.vm.box = "apache" | |
end | |
config.vm.synced_folder Dir.pwd + "/migrate/", "/migrate" | |
config.vm.network :forwarded_port, guest: 80, host: 8080 | |
config.vm.network :forwarded_port, guest: 443, host: 8443 | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "1096"] | |
# Set the timezone to the host timezone | |
require 'time' | |
timezone = 'Etc/GMT' + ((Time.zone_offset(Time.now.zone)/60)/60).to_s | |
config.vm.provision :shell, :inline => "if [ $(grep -c UTC /etc/timezone) -gt 0 ]; then echo \"#{timezone}\" | sudo tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata; fi" | |
end | |
config.vm.provision "shell", inline: $script | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment