Project

General

Profile

root / branches / 5.0.x / docker / SCENARIsuite-starter / docker-entrypoint.sh @ 41

1
#!/bin/bash
2
if [ -z "$SC_PUBLIC_URL" ] ; then
3
  echo 'SC_PUBLIC_URL is mandatory.'
4
  echo "    example: SC_PUBLIC_URL=http://mydomain:8080/$SC_WEBAPP_NAME"
5
  exit 1
6
else
7
  echo "Example reverse proxy: $SC_PUBLIC_URL => http://CONTAINER_IP:PUBLISH_PORT/$SC_WEBAPP_NAME"
8
fi
9

    
10
if [ -z "$SC_USER_SYSTEM_PASS" ] ; then
11
  export SC_USER_SYSTEM_PASS=$(pwgen -s 32 1)
12
  echo "Generated password for user 'system': $SC_USER_SYSTEM_PASS"
13
fi
14
if [ -z "$SC_USER_SADMIN_PASS" ] ; then
15
  export SC_USER_SADMIN_PASS=$(pwgen -s 32 1)
16
  echo "Generated password for user 'superadmin': $SC_USER_SADMIN_PASS"
17
fi
18

    
19
cd /var/cache/scenari
20
# SET PASSWORD
21
perl -pi -e "s|user.system.password=ErT8MpdUH7oPlXtH|user.system.password=$SC_USER_SYSTEM_PASS|" conf/users.properties
22
perl -pi -e "s|user.superadmin.password=FuT5MpdUH7oPrXtW|user.superadmin.password=$SC_USER_SUPERADMIN_PASS|" conf/users.properties
23

    
24
# SET URL
25
perl -pi -e "s|webapp.public.url=http://192.168.0.1:8080/scchainsrv50|webapp.public.url=$SC_PUBLIC_URL|" conf/webapp.properties
26
if [ ! -z "SC_WEBAPP_NAME" ] ; then
27
  perl -pi -e "s|webapp.code=scsuitestr50|webapp.code=$SC_WEBAPP_NAME|" conf/webapp.properties
28
fi
29

    
30
# SET PATH
31
perl -pi -e "s|webapp.work.dir=/var/lib/scsuitestr50|webapp.work.dir=/var/lib/scenari|" conf/webapp.properties
32
perl -pi -e "s|webapp.logs.dir=/var/log/scsuitestr50|webapp.logs.dir=/var/log/scenari|" conf/webapp.properties
33

    
34
# MAKE WAR
35
./makeSrv.sh > /dev/null
36
# INSTALL WAR
37
cp -a /var/cache/scenari/_release/*.war /var/lib/jetty9/webapps
38

    
39
cd /var/lib/scenari
40
exec "$@"
(2-2/3)