forked from gocd/gocd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
79 lines (64 loc) · 2.73 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.synced_folder "~/.m2", "/home/vagrant/.m2"
config.vm.synced_folder "~/.gradle", "/home/vagrant/.gradle"
config.vm.synced_folder "~/.npm", "/home/vagrant/.npm"
packages = []
packages << 'java-1.8.0-openjdk-devel'
packages << %w(zip unzip gzip bzip2) # compression tools
packages << %w(git)
packages << %w(createrepo yum-utils rpm-build yum-utils) #for building rpm packages
packages << %w(dpkg-devel dpkg-dev) #for building debian packages
packages << %w(mingw32-nsis) #for building windows exe packages
packages << %w(wget curl) #for downloading stuff
packages << %w(nodejs-devel yarn) #nodejs for compiling rails assets
packages << %w(devtoolset-6-gcc-c++ devtoolset-6-gcc) #to compile stuff via rubygems, npm etc
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
config.vm.provision :shell, inline: <<-SHELL
set -ex
echo '
[nsis]
name=nsis
baseurl=https://gocd.github.io/nsis-rpm/
gpgcheck=0
' > /etc/yum.repos.d/nsis.repo
echo '
[nodesource]
name=Node.js Packages for Enterprise Linux $releasever - $basearch
baseurl=https://rpm.nodesource.com/pub_6.x/el/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
sslverify=true
' > /etc/yum.repos.d/nodesource.repo
wget -q https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
yum install -y epel-release centos-release-scl
yum install -y #{packages.flatten.join(' ')}
echo 'source /opt/rh/rh-ruby22/enable' > /etc/profile.d/ruby-22.sh
echo 'export PATH=/opt/rh/rh-ruby22/root/usr/local/bin:$PATH' >> /etc/profile.d/ruby-22.sh
echo 'source /opt/rh/devtoolset-6/enable' > /etc/profile.d/gcc.sh
echo 'PATH=$PATH:/opt/rh/devtoolset-6/root/usr/bin' >> /etc/profile.d/gcc.sh
(source /opt/rh/rh-ruby22/enable; gem install fpm --no-ri --no-rdoc)
SHELL
config.vm.provider :virtualbox do |vb, override|
override.vm.box = "boxcutter/centos67"
vb.gui = ENV['GUI'] || false
vb.memory = ((ENV['MEMORY'] || 4).to_f * 1024).to_i
vb.cpus = 4
end
if Vagrant.has_plugin?('vagrant-cachier')
config.cache.scope = :box
config.cache.enable :apt
config.cache.enable :apt_lists
config.cache.enable :yum
config.cache.enable :npm
end
if Vagrant.has_plugin?('vagrant-vbguest')
config.vbguest.auto_update = false
end
end