-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch.bash
44 lines (37 loc) · 1.24 KB
/
launch.bash
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
#!/bin/bash
set -o errexit
. /usr/local/share/atlassian/common.bash
sudo own-volume
rm -f /opt/atlassian-home/.jira-home.lock
if [ "$CONTEXT_PATH" == "ROOT" -o -z "$CONTEXT_PATH" ]; then
CONTEXT_PATH=
else
CONTEXT_PATH="/$CONTEXT_PATH"
fi
xmlstarlet ed -u '//Context/@path' -v "$CONTEXT_PATH" conf/server-backup.xml > conf/server.xml
if [ -n "$DATABASE_URL" ]; then
extract_database_url "$DATABASE_URL" DB /opt/jira/lib
DB_JDBC_URL="$(xmlstarlet esc "$DB_JDBC_URL")"
cat <<END > /opt/atlassian-home/dbconfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>$DB_TYPE</database-type>
<schema-name>public</schema-name>
<jdbc-datasource>
<url>$DB_JDBC_URL</url>
<driver-class>$DB_JDBC_DRIVER</driver-class>
<username>$DB_USER</username>
<password>$DB_PASSWORD</password>
<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>
<pool-max-wait>30000</pool-max-wait>
<pool-max-idle>20</pool-max-idle>
<pool-remove-abandoned>true</pool-remove-abandoned>
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
</jdbc-datasource>
</jira-database-config>
END
fi
/opt/jira/bin/start-jira.sh -fg