forked from ianunruh/monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-sentry.sh
executable file
·51 lines (37 loc) · 1.05 KB
/
install-sentry.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
#!/bin/bash
##
# Installs the Sentry event logging and aggregation platform
#
# Configured with the username `admin` and the password `secret`.
#
# Provides:
# - HTTP (TCP/9000)
#
# Dependencies:
# - Memcached (TCP/11211)
# - PostgreSQL (TCP/5432)
# - Redis (TCP/6379)
##
set -eux
source env.sh
SENTRY_PATH=/usr/share/sentry
SENTRY_CONFIG=/etc/sentry/settings.py
apt-get update -q
apt-get install -yq python-pip python-dev libffi-dev libxml2-dev libxslt1-dev libpq-dev supervisor
pip install virtualenv
virtualenv $SENTRY_PATH
set +eux
source $SENTRY_PATH/bin/activate
set -eux
pip install sentry[postgres] sentry-top
sudo -i -u postgres psql <<EOF
CREATE USER sentry WITH PASSWORD 'sekret';
CREATE DATABASE sentry OWNER sentry;
EOF
mkdir -p /etc/sentry
cp $BASE_PATH/usr/share/sentry/initial_data.json $SENTRY_PATH
cp $BASE_PATH/etc/sentry/settings.py /etc/sentry
sentry --config=$SENTRY_CONFIG upgrade --noinput
cp $BASE_PATH/etc/supervisor/conf.d/sentry.conf /etc/supervisor/conf.d
cp $BASE_PATH/usr/local/bin/sentry-top /usr/local/bin
supervisorctl update