Files
Docker-Chevereto/scripts/chevereto.sh

35 lines
1011 B
Bash
Raw Normal View History

2021-06-13 16:05:26 -04:00
#!/usr/bin/env bash
set -e
DIR="/var/www"
WORKING_DIR="$DIR/html"
2022-04-01 16:04:53 -03:00
ls -la $WORKING_DIR
CHEVERETO_PACKAGE=$CHEVERETO_TAG"-lite"
CHEVERETO_API_DOWNLOAD="https://chevereto.com/api/download/"
chv_install() {
rm -rf /chevereto/download
echo "Making working dir /chevereto/download"
mkdir -p /chevereto/download
echo "cd /chevereto/download"
cd /chevereto/download
echo "* Downloading chevereto/v4 $CHEVERETO_PACKAGE package"
curl -f -SOJL \
-H "License: $CHEVERETO_LICENSE" \
"${CHEVERETO_API_DOWNLOAD}${CHEVERETO_PACKAGE}"
echo "* Extracting package"
unzip -oq ${CHEVERETO_SOFTWARE}*.zip -d $WORKING_DIR
echo "* Installing dependencies"
composer install \
--working-dir=$WORKING_DIR/app \
--no-progress \
--classmap-authoritative \
--ignore-platform-reqs
}
2022-04-02 19:59:46 -03:00
if [ -f "$WORKING_DIR/app/composer.json" ]; then
echo "[NOTICE] Sourcing app from ./chevereto"
else
2022-04-01 16:04:53 -03:00
chv_install
fi
cd $WORKING_DIR
2022-04-03 14:53:30 -04:00
chown www-data: . -R
ls -la