Commit ac3ed4bef9e401a67cf47714edd2c1a76412b33b
Committed by
Sergio Oliveira
1 parent
33626ba3
Exists in
master
and in
39 other branches
Updating Trac script to create database
Updating conf file for supervisor Updating Trac script
Showing
1 changed file
with
18 additions
and
2 deletions
Show diff stats
scripts/trac.sh
| 1 | 1 | #!/bin/bash |
| 2 | 2 | |
| 3 | +if [[ ! "$1" ]] | |
| 4 | + then | |
| 5 | + echo " Parametro nao encontrado." | |
| 6 | + echo " ./tra.sh <DATABASE_HOST>" | |
| 7 | + exit -1 | |
| 8 | +fi | |
| 9 | + | |
| 10 | +DATABASE_HOST=$1 | |
| 11 | + | |
| 12 | +sudo rm -rf /opt/trac | |
| 13 | + | |
| 14 | +if [[ $DATABASE_HOST == "127.0.0.1" ]]; then | |
| 15 | + sudo -u postgres psql -c "DROP DATABASE trac_colab;" | |
| 16 | + sudo -u postgres psql -c "CREATE DATABASE trac_colab WITH OWNER colab ENCODING 'UTF8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0;" | |
| 17 | +fi | |
| 18 | + | |
| 3 | 19 | sudo yum install -y wget |
| 4 | 20 | sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://www.fedoraproject.org/static/0608B895.txt |
| 5 | 21 | sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 |
| ... | ... | @@ -15,7 +31,7 @@ sudo easy_install psycopg2 |
| 15 | 31 | sudo yum install -y trac |
| 16 | 32 | |
| 17 | 33 | sudo mkdir -p /opt/trac |
| 18 | -sudo trac-admin /opt/trac initenv colab postgres://colab:colab@/trac_colab?host=$1 | |
| 34 | +sudo trac-admin /opt/trac initenv colab postgres://colab:colab@/trac_colab?host=$DATABASE_HOST | |
| 19 | 35 | |
| 20 | 36 | sudo yum install subversion -y |
| 21 | 37 | |
| ... | ... | @@ -30,7 +46,7 @@ directory=/opt/trac |
| 30 | 46 | user=root |
| 31 | 47 | autostart=true |
| 32 | 48 | autorestart=false |
| 33 | -redirect_stderr=True\" >> /etc/supervisord.conf" | |
| 49 | +redirect_stderr=True\" > /etc/supervisor/conf.d/trac.conf" | |
| 34 | 50 | |
| 35 | 51 | sudo service supervisord start |
| 36 | 52 | ... | ... |