SHARE
TWEET

Untitled

a guest Jun 24th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. initialize() {
  2.     echo "mayan: initialize()"
  3.     su mayan -c "${MAYAN_BIN} initialsetup --force"
  4.     su mayan -c "${MAYAN_BIN} collectstatic --noinput --clear"
  5. }
  6.  
  7. upgrade() {
  8.     echo "mayan: upgrade()"
  9.     su mayan -c "${MAYAN_BIN} performupgrade"
  10.     su mayan -c "${MAYAN_BIN} collectstatic --noinput --clear"
  11. }
  12.  
  13. start() {
  14.     echo "mayan: start()"
  15.     rm -rf /var/run/supervisor.sock
  16.     exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
  17. }
  18.  
  19. os_package_installs() {
  20.     echo "mayan: os_package_installs()"
  21.     if [ "${MAYAN_APT_INSTALLS}" ]; then
  22.         apt-get-install $MAYAN_APT_INSTALLS
  23.     fi
  24. }
  25.  
  26. pip_installs() {
  27.     echo "mayan: pip_installs()"
  28.     if [ "${MAYAN_PIP_INSTALLS}" ]; then
  29.         $MAYAN_PIP_BIN install $MAYAN_PIP_INSTALLS
  30.     fi
  31. }
  32.  
  33. os_package_installs || true
  34. pip_installs || true
  35.  
  36. case "$1" in
  37.  
  38. mayan) # Check if this is a new install, otherwise try to upgrade the existing
  39.        # installation on subsequent starts
  40.        if [ ! -f $INSTALL_FLAG ]; then
  41.            initialize
  42.        else
  43.            upgrade
  44.        fi
  45.        start
  46.        ;;
  47.  
  48. run-tests) # Check if this is a new install, otherwise try to upgrade the existing
  49.            # installation on subsequent starts
  50.            if [ ! -f $INSTALL_FLAG ]; then
  51.                initialize
  52.            else
  53.                upgrade
  54.            fi
  55.            $DOCKER_ROOT/run-tests.sh
  56.            ;;
  57.  
  58. *) su mayan -c "$@";
  59.    ;;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top