-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathstoqdev-lxd-profile.yaml
91 lines (91 loc) · 2.89 KB
/
stoqdev-lxd-profile.yaml
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
config:
environment.DISPLAY: :0
raw.idmap: both 1000 1000
user.user-data: |
#cloud-config
write_files:
- content: |
#!/bin/bash
set -e
if [ -f ~/STOQDEV_DONE ]; then
echo "Stoq development already bootstrapped!"
exit
fi
rm -f ~/STOQDEV_DONE
echo "Bootstraping poetry ..."
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > /tmp/get-poetry.py
python3 /tmp/get-poetry.py --force --yes
RELEASE="$(lsb_release -sr)"
echo "Post installation fixes for: $RELEASE"
case "$RELEASE" in
16.04)
# twice for lucky
python3 -m pip install --upgrade "pip < 21.0" poetry || python3 -m pip install --upgrade "pip < 21.0" poetry
;;
*)
echo "Nothing needed!"
;;
esac
echo "Generating locales needed ..."
sudo locale-gen pt_BR.UTF-8
echo "Bootstraping NVM and yarn ..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
source /home/ubuntu/.nvm/nvm.sh
nvm install v10
nvm use v10
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn -y
npm install -g firebase-tools
touch ~/STOQDEV_DONE
echo "Stoq development bootstraped ..."
path: /home/ubuntu/bootstrap.sh
runcmd:
- 'sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf'
- 'echo export PULSE_SERVER=unix:/tmp/.pulse-native | tee --append /home/ubuntu/.profile'
- 'chown ubuntu.ubuntu /home/ubuntu/.profile'
- 'chown ubuntu.ubuntu /home/ubuntu'
- 'chown ubuntu.ubuntu /home/ubuntu/bootstrap.sh'
- 'chmod +x /home/ubuntu/bootstrap.sh'
- 'sudo -u ubuntu /home/ubuntu/bootstrap.sh'
- 'sudo -u postgres createuser ubuntu -drs'
packages:
- default-jre-headless
- libcups2
- libffi-dev
- libgdk-pixbuf2.0-0
- libgtk-3-0
- libjpeg8-dev
- libnss3-dev
- libpango1.0-0
- libpangocairo-1.0-0
- libpq-dev
- libssl-dev
- libxcomposite1
- libxml2-utils
- libxss1
- mesa-utils
- poppler-utils
- postgresql
- pulseaudio
- python3-pip
- swig
- x11-apps
- zlib1g-dev
description: STOQ development profile
devices:
PASocket:
path: /tmp/.pulse-native
source: /run/user/1000/pulse/native
type: disk
X0:
path: /tmp/.X11-unix/X0
source: /tmp/.X11-unix/X0
type: disk
homedir:
path: /home/ubuntu/Development
source: /home/cprov/Development
type: disk
mygpu:
type: gpu
name: stoqdev