-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
102 lines (93 loc) · 4.58 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Maybe I will try vagrant box from https://roboxes.org/ later.
config.vm.box = "ubuntu/xenial64"
config.vm.box_version = "20200326.0.0"
# for vagrant plugin vagrant-disksize
config.disksize.size = '50GB'
# All configurations use 10.20.30.40 as entry.
config.vm.network "private_network", ip: "10.20.30.40"
# Create a forwarded port mapping which allows access to a specific port
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.network "forwarded_port", guest: 10080, host: 10080
config.vm.provider "virtualbox" do |vb|
vb.cpus = "2"
vb.memory = "2048"
end
# Let timezone in guest be same as host
# Install timezone plugin:
# $ vagrant plugin install vagrant-timezone
if Vagrant.has_plugin?("vagrant-timezone")
config.timezone.value = "Asia/Taipei"
end
## Provision -- default run only once.
## vagrant provision --provision-with nvm
config.vm.provision "nvm", type: "shell",
path: "https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh",
privileged: false
## vagrant provision --provision-with npm
config.vm.provision "npm", type: "shell",
inline: "apt-get update && apt-get -y install npm",
privileged: true
## vagrant provision --provision-with unzip
config.vm.provision "unzip", type: "shell",
inline: "sudo apt-get install unzip",
privileged: false
## vagrant provision --provision-with vim
## Equivalent to `curl -o- https://raw.githubusercontent.com/humorless/dotfiles/master/vim/install_plugin.sh | bash`
config.vm.provision "vim", type: "shell",
path: "https://raw.githubusercontent.com/humorless/dotfiles/master/vim/install_plugin.sh",
privileged: false
## vagrant provision --provision-with vim8
config.vm.provision "vim8", type: "shell",
inline: "add-apt-repository ppa:jonathonf/vim && apt-get -y update && apt-get -y install vim",
privileged: true
## vagrant provision --provision-with boot
config.vm.provision "boot", type: "shell",
inline: "cd /usr/local/bin && curl -fsSLo boot https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && chmod 755 boot",
privileged: true
## vagrant provision --provision-with lein
config.vm.provision "lein", type: "shell",
inline: "cd /usr/local/bin && curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein && chmod a+x /usr/local/bin/lein",
privileged: true
## vagrant provision --provision-with java
config.vm.provision "java", type: "shell",
inline: "apt-get -y install openjdk-8-jre-headless",
privileged: true
## vagrant provision --provision-with lein-config-file
config.vm.provision "lein-config-file", type: "file",
source: "./lein/profiles.clj",
destination: "~/.lein/profiles.clj"
## Note1: if ~/.bash_aliases has CRLF char, it will not work
## In this case, use the command dos2unix properly
## Note2: vagrant upload *localfile* is another shortcut to upload
## vagrant provision --provision-with bash-alias-file
config.vm.provision "bash-alias-file", type: "file",
source: "./bash/bash_aliases",
destination: "~/.bash_aliases"
## autojump is likely to fail because apt-get cannot locate package
## vagrant provision --provision-with autojump
config.vm.provision "autojump", type: "shell",
inline: "sudo apt-get update && sudo apt-get install autojump && echo \". /usr/share/autojump/autojump.sh\" >> /home/vagrant/.bashrc",
privileged: false
## vagrant provision --provision-with cljfmt
config.vm.provision "cljfmt", type: "shell",
inline: "npm install -g node-cljfmt",
privileged: true
## vagrant provision --provision-with chrome
config.vm.provision "chrome", type: "shell",
inline: "cd /tmp && sudo apt-get -y update && sudo apt-get -y install libxss1 libappindicator1 libindicator7 && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo apt -y install ./google-chrome-stable_current_amd64.deb",
privileged: false
## vagrant provision --provision-with webdriver
config.vm.provision "webdriver", type: "shell",
inline: "cd /tmp && wget https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && sudo mv chromedriver /usr/bin/ ",
privileged: false
## Ansible is not as good as I originally thought
## vagrant provision --provision-with ansible_local
#config.vm.provision "ansible_local" do |ansible|
# ansible.playbook = "playbook.yml"
# ansible.galaxy_role_file = "requirements.yml"
# ansible.verbose = true
#end
end