mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 12:55:18 +00:00
Vagrantfile: Update to new structure (and Go version)
Also add /.vagrant to .gitignore
This commit is contained in:
parent
1ab8220022
commit
cc8a929d43
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
/pkg
|
/pkg
|
||||||
/bin
|
/bin
|
||||||
/restic
|
/restic
|
||||||
|
/.vagrant
|
||||||
|
17
Vagrantfile
vendored
17
Vagrantfile
vendored
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: ruby -*-
|
# -*- mode: ruby -*-
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
GO_VERSION = '1.4.2'
|
GO_VERSION = '1.6'
|
||||||
|
|
||||||
def packages_freebsd
|
def packages_freebsd
|
||||||
return <<-EOF
|
return <<-EOF
|
||||||
@ -57,24 +57,23 @@ def prepare_user(boxname)
|
|||||||
|
|
||||||
gimme #{GO_VERSION} >> ~/.profile
|
gimme #{GO_VERSION} >> ~/.profile
|
||||||
echo export 'GOPATH=/vagrant/go' >> ~/.profile
|
echo export 'GOPATH=/vagrant/go' >> ~/.profile
|
||||||
echo export 'CDPATH=.:$GOPATH/src/github.com' >> ~/.profile
|
|
||||||
echo export 'PATH=$GOPATH/bin:/usr/local/bin:$PATH' >> ~/.profile
|
echo export 'PATH=$GOPATH/bin:/usr/local/bin:$PATH' >> ~/.profile
|
||||||
|
|
||||||
. ~/.profile
|
. ~/.profile
|
||||||
|
|
||||||
go get golang.org/x/tools/cmd/cover
|
go get golang.org/x/tools/cmd/cover
|
||||||
go get github.com/tools/godep
|
go get github.com/constabulary/gb/...
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Run:"
|
echo "Run:"
|
||||||
echo " vagrant rsync #{boxname}"
|
echo " vagrant rsync #{boxname}"
|
||||||
echo " vagrant ssh #{boxname} -c 'cd project/path; godep go test ./...'"
|
echo " vagrant ssh #{boxname} -c 'cd /vagrant; gb build && gb test'"
|
||||||
EOF
|
EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_perms
|
def fix_perms
|
||||||
return <<-EOF
|
return <<-EOF
|
||||||
chown -R vagrant /vagrant/go
|
chown -R vagrant /vagrant
|
||||||
EOF
|
EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -84,12 +83,16 @@ end
|
|||||||
# you're doing.
|
# you're doing.
|
||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
# use rsync to copy content to the folder
|
# use rsync to copy content to the folder
|
||||||
config.vm.synced_folder ".", "/vagrant/go/src/github.com/restic/restic", :type => "rsync"
|
config.vm.synced_folder ".", "/vagrant", :type => "rsync"
|
||||||
config.vm.synced_folder ".", "/vagrant", disabled: true
|
|
||||||
|
|
||||||
# fix permissions on synced folder
|
# fix permissions on synced folder
|
||||||
config.vm.provision "fix perms", :type => :shell, :inline => fix_perms
|
config.vm.provision "fix perms", :type => :shell, :inline => fix_perms
|
||||||
|
|
||||||
|
# fix network card
|
||||||
|
config.vm.provider "virtualbox" do |v|
|
||||||
|
v.customize ["modifyvm", :id, "--nictype1", "virtio"]
|
||||||
|
end
|
||||||
|
|
||||||
config.vm.define "linux" do |b|
|
config.vm.define "linux" do |b|
|
||||||
b.vm.box = "ubuntu/trusty64"
|
b.vm.box = "ubuntu/trusty64"
|
||||||
b.vm.provision "packages linux", :type => :shell, :inline => packages_linux
|
b.vm.provision "packages linux", :type => :shell, :inline => packages_linux
|
||||||
|
Loading…
Reference in New Issue
Block a user