forked from chaoss/augur
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
108 lines (92 loc) · 2.76 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
103
104
105
106
107
108
$script = <<-'SCRIPT'
set -euxo pipefail
sudo apt-get -y update
sudo apt-get -y install --no-install-recommends \
build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev \
git gcc gfortran \
python3 python3-pip python3.8-venv \
postgresql postgresql-contrib \
libomp-dev \
golang libgomp1
sudo pg_ctlcluster 12 main start
go get -u github.com/boyter/scc/
# # install Go
# installGo() (
# cd "$(mktemp -d)"
# wget https://golang.org/dl/go1.16.5.linux-amd64.tar.gz
# rm -rf /usr/local/go && tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz
# )
# sudo installGo
# export PATH=$PATH:/usr/local/go/bin
##########################################################################################
# see: https://oss-augur.readthedocs.io/en/master/getting-started/database.html
cat <<EOF > /tmp/init.psql
CREATE DATABASE augur;
CREATE USER augur WITH ENCRYPTED PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE augur TO augur;
EOF
sudo -u postgres psql -U postgres -f /tmp/init.psql
##########################################################################################
# see: https://oss-augur.readthedocs.io/en/master/getting-started/installation.html
mkdir -p "$HOME/augur/" "$HOME/augur/logs/" "$HOME/augur/repos/"
cat <<EOF > "$HOME/augur/config.json"
{
"Database": {
"host": "localhost",
"password": "password"
},
"Server": {
"host": "0.0.0.0"
},
"Logging": {
"logs_directory": "$HOME/augur/logs/",
"log_level": "INFO",
"verbose": 0,
"quiet": 0,
"debug": 1
},
"Workers": {
"facade_worker": {
"repo_directory": "$HOME/augur/repos/",
"switch": 1
},
"github_worker": {
"switch": 1
},
"insight_worker": {
"switch": 1
},
"linux_badge_worker": {
"switch": 1
},
"pull_request_worker": {
"switch": 1
},
"repo_info_worker": {
"switch": 1
},
"release_worker": {
"switch": 1
}
}
}
EOF
python3 -m venv $HOME/.virtualenvs/augur_env
source $HOME/.virtualenvs/augur_env/bin/activate
pip install wheel
cd /vagrant
python setup.py bdist_wheel
make clean
make install-dev
augur config init --rc-config-file "$HOME/config.json"
augur db create-schema
augur backend start"
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.provider "virtualbox" do |v|
v.memory = 20480
v.cpus = 4
end
config.vm.provision "shell", privileged: false, inline: $script
end