Skip to content

Commit 8806f6b

Browse files
committed
Add a vagrant file to allow local development and testing of installers.
1 parent 27511b3 commit 8806f6b

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,4 @@ test-utils/target/
131131
tfs-impl/target/
132132
tw-go-plugins/dist/
133133
util/target/
134+
.vagrant/

Vagrantfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure(2) do |config|
9+
config.vm.synced_folder "~/.m2", "/home/vagrant/.m2"
10+
config.vm.synced_folder "~/.gradle", "/home/vagrant/.gradle"
11+
12+
packages = []
13+
14+
packages << 'java-1.7.0-openjdk-devel'
15+
packages << %w(zip unzip gzip bzip2) # compression tools
16+
packages << %w(git)
17+
packages << %w(createrepo yum-utils rpm-build yum-utils) #for building rpm packages
18+
packages << %w(dpkg-devel dpkg-dev) #for building debian packages
19+
packages << %w(mingw32-nsis) #for building windows exe packages
20+
packages << %w(wget curl) #for downloading stuff
21+
packages << %w(nodejs010-nodejs nodejs010-npm) #nodejs for compiling rails assets
22+
packages << %w(rh-ruby22 rh-ruby22-ruby-devel rh-ruby22-rubygem-bundler rh-ruby22-ruby-irb rh-ruby22-rubygem-rake rh-ruby22-rubygem-psych libffi-devel) #ruby needed for fpm
23+
24+
config.vm.provision :shell, inline: <<-SHELL
25+
set -ex
26+
echo '
27+
[nsis]
28+
name=nsis
29+
baseurl=https://gocd.github.io/nsis-rpm/
30+
gpgcheck=0
31+
' > /etc/yum.repos.d/nsis.repo
32+
33+
yum install -y -q epel-release centos-release-scl
34+
yum install -y -q #{packages.flatten.join(' ')}
35+
36+
echo 'source /opt/rh/rh-ruby22/enable' > /etc/profile.d/ruby-22.sh
37+
echo 'export PATH=/opt/rh/rh-ruby22/root/usr/local/bin:$PATH' >> /etc/profile.d/ruby-22.sh
38+
echo 'source /opt/rh/nodejs010/enable' > /etc/profile.d/node-0.10.sh
39+
40+
(source /opt/rh/rh-ruby22/enable; gem install fpm --no-ri --no-rdoc)
41+
SHELL
42+
43+
config.vm.provider :virtualbox do |vb, override|
44+
override.vm.box = "boxcutter/centos67"
45+
46+
vb.gui = ENV['GUI'] || false
47+
vb.memory = ((ENV['MEMORY'] || 4).to_f * 1024).to_i
48+
vb.cpus = 4
49+
end
50+
51+
if Vagrant.has_plugin?('vagrant-cachier')
52+
config.cache.scope = :box
53+
config.cache.enable :apt
54+
config.cache.enable :apt_lists
55+
config.cache.enable :yum
56+
end
57+
58+
if Vagrant.has_plugin?('vagrant-vbguest')
59+
config.vbguest.auto_update = false
60+
end
61+
62+
end

0 commit comments

Comments
 (0)