-
Notifications
You must be signed in to change notification settings - Fork 3
/
Vagrantfile
55 lines (42 loc) · 2.16 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
# vi: set ft=ruby :
Vagrant.require_plugin "vagrant-omnibus" # see https://github.com/locomote/gusteau/pull/41#issuecomment-26941842
Vagrant.require_plugin "cachier" # optional, comment this out if you'd prefer
Vagrant.configure('2') do |config|
# config.ssh.forward_agent = true # enable if deploying from private repo
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.omnibus.chef_version = '11.6.0'
config.cache.auto_detect = true # vagrant-cachier plugin greatly speeds up provisions
config.vm.provision :shell, :inline => "apt-get update; apt-get install -y vim curl git"
config.vm.provision "chef_solo" do |chef|
chef.json = {
"mysql" => {
"server_root_password" => "root",
"server_debian_password" => "root",
"server_repl_password" => "root"
}
}
chef.add_recipe "apt::default"
chef.add_recipe "redmine::dependencies"
chef.add_recipe "redmine::default"
chef.add_recipe "redmine::database"
chef.add_recipe "redmine::nginx"
end
# development tweaks, assumes redmine 2.x plugins path
config.vm.provision :shell, :inline => <<-EOT
export REDMINE_ROOT=/opt/redmine
cd $REDMINE_ROOT
# install plugin, which is mounted on /vagrant
test -d plugins/redmine_atjs || ln -s /vagrant $REDMINE_ROOT/plugins/redmine_atjs
# avoids need to restart server when editing redmine-atjs.js file; path assumes redmine 2.x
export SOURCE_JS_PATH=$REDMINE_ROOT/plugins/redmine_atjs/assets/javascripts/redmine-atjs.js
export TARGET_JS_PATH=$REDMINE_ROOT/public/plugin_assets/redmine_atjs/javascripts/redmine-atjs.js
test -f $TARGET_JS_PATH && rm $TARGET_JS_PATH
ln -s $SOURCE_JS_PATH $TARGET_JS_PATH
# TODO: fix the following error that pops up ONLY ON THE FIRST PROVISION
# ln: failed to create symbolic link `/opt/redmine/public/plugin_assets/redmine_atjs/javascripts/redmine-atjs.js': No such file or directory
# populate with sample data (projects, issues); raises exception in redmine 2.3.3 but still works
rake db:fixtures:load 2> /dev/null || /bin/true
EOT
end