-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
58 lines (47 loc) · 1.44 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
# -*- mode: ruby -*-
# vi: set ft=ruby ts=2 sw=2 expandtab :
PROJECT = "rust_sentence_aligner"
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
Vagrant.configure(2) do |config|
config.vm.define "db" do |db|
db.vm.provider "docker" do |d|
d.image = "postgres:9.5"
d.name = "#{PROJECT}_db"
d.env = {
"POSTGRES_PASSWORD" => "vagrant",
"POSTGRES_USER" => "vagrant",
"POSTGRES_DB" => "vagrant",
}
end
end
config.ssh.insert_key = false
config.vm.define "dev", primary: true do |app|
app.vm.provider "docker" do |d|
d.image = "allansimon/docker-dev-rust"
d.name = "#{PROJECT}_dev"
d.link "#{PROJECT}_db:db"
d.has_ssh = true
d.env = {
"HOST_USER_UID" => Process.euid,
# only one thread allocated for tests
# as database is cleaned in every test;
# parallel tests execution might result in data deletion
# even if this data is used by another test
"RUST_TEST_THREADS" => "1",
"DB_USER" => "vagrant",
"DB_PASSWORD" => "vagrant",
"DB_HOST" => "db",
"DB_NAME" => "vagrant",
}
end
app.ssh.username = "vagrant"
# libssl-dev is required by reqwest when testing
app.vm.provision "installs", "type": "shell" do |installs|
installs.inline = "
sudo apt-get update
sudo apt-get install pkg-config libssl-dev -y
"
end
end
end