2023-09-28 10:01:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "Installing Composer packages..."
|
|
|
|
composer create-project --no-dev
|
|
|
|
|
|
|
|
echo "Installing Yarn packages..."
|
|
|
|
(cd public/static && yarn install)
|
|
|
|
|
|
|
|
echo "Updating version info..."
|
|
|
|
VERSION=$(git describe --tags --always --match "Release_*" HEAD)
|
|
|
|
REVISION=$(git rev-parse --short HEAD)
|
|
|
|
REVISION_DATE=$(git show -s --format=%aI HEAD)
|
2023-09-28 12:16:38 +02:00
|
|
|
sed -i -E "s/const VERSION = '(.*)';/const VERSION = '${VERSION}';/" app.php
|
|
|
|
sed -i -E "s/const REVISION = '(.*)';/const REVISION = '${REVISION}';/" app.php
|
|
|
|
sed -i -E "s/const REVISION_DATE = '(.*)';/const REVISION_DATE = '${REVISION_DATE}';/" app.php
|
2023-09-28 10:01:38 +02:00
|
|
|
|
|
|
|
echo "Minifying JS, CSS and SVG files..."
|
|
|
|
find public/static/js -type f -iname '*.js' -exec uglifyjs {} -c -m -o {} \;
|
|
|
|
find public/static/css -type f -iname '*.css' -exec cleancss {} -o {} \;
|
|
|
|
find public/static/img -type f -iname '*.svg' -exec svgo {} -o {} \;
|
|
|
|
|
|
|
|
echo "Linking view files..."
|
|
|
|
./mapg view:link
|
|
|
|
|
|
|
|
rm .env
|