This repository has been archived by the owner on Oct 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
69 lines (57 loc) · 1.96 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
# Install the working environment based on fine grained provisioners.
Vagrant.configure("2") do |config|
config.vm.define "spip-testing"
config.vm.box = "bento/ubuntu-18.04"
config.vm.host_name = "localhost"
config.vm.hostname = "spip-testing"
config.ssh.forward_agent = true
config.vm.network "private_network", ip: "192.168.50.4"
config.vm.synced_folder "./", "/vagrant",
id: "vagrant-root",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=755", "fmode=644"],
nfs: false
config.vm.provider :virtualbox do |vb|
vb.name = "spip-testing"
vb.customize ["modifyvm", :id, "--memory", "512"]
end
# Provision with root user.
# ===========================================================================
config.vm.provision 'os',
type: :shell,
path: "vagrant/root-os.sh"
# Provision with vagrant user.
# ===========================================================================
config.vm.provision 'spip',
type: :shell,
privileged: false,
path: "vagrant/user-spip.sh"
# Finishing up
# ===========================================================================
# Clean the machine of unnecessary clutter.
config.vm.provision 'clean',
type: :shell,
inline: <<-SHELL
echo "
`date '+%H:%M'`: Cleaning up the machine…
========================================================================"
apt-get autoremove -y
apt-get autoclean -y
apt-get clean -y
SHELL
# Ding!
# And whatever one likes to happen at the end of every `vagrant up`.
config.vm.provision 'done',
type: :shell,
run: "always",
inline: <<-SHELL
echo -e "
`date '+%H:%M'`: Done! \a
You can access the box with http://192.168.50.4/.
NB: From time to time, it wouldn’t hurt to do a \\\`vagrant ssh\\\`,
then \\\`sudo apt upgrade\\\` to upgrade all
packages.
=========================================================================="
SHELL
end