-
Notifications
You must be signed in to change notification settings - Fork 2
/
provision.sh
55 lines (41 loc) · 1.06 KB
/
provision.sh
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
#!/bin/sh
set -e
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
git \
libbz2-dev \
libffi-dev \
liblzma-dev \
libpq-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
zlib1g-dev \
postgresql-15
install_asdf() {
test -d ~/.asdf || git clone --depth 1 https://github.com/asdf-vm/asdf.git ~/.asdf
grep -q asdf.sh $HOME/.bashrc || echo "source $HOME/.asdf/asdf.sh" >> $HOME/.bashrc
export PATH="$PATH:/$HOME/.asdf/bin"
}
install_asdf_plugins() {
for tool in $(cut -d ' ' -f 1 .tool-versions); do
asdf plugin add $tool
done
}
install_asdf
cd /vagrant
install_asdf_plugins
asdf install
ASDF_INSTALLS="$HOME/.asdf/installs"
export PATH="$PATH:$ASDF_INSTALLS/python/3.11.4/bin"
export PATH="$PATH:$ASDF_INSTALLS/poetry/1.6.0/bin"
export PATH="$PATH:$ASDF_INSTALLS/nodejs/16.20.2/bin"
export PATH="$PATH:$ASDF_INSTALLS/yarn/1.22.19/bin"
poetry install
yarn install --frozen-lockfile
yarn build
sudo su postgres -c 'createuser vagrant -s' || true
sudo su vagrant -c 'createdb weave' || true
poetry run flask reset-db