From cede0e7985782cb9e1117ec57516e4d75e74a44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 16 Sep 2023 15:05:48 +0200 Subject: [PATCH] add release generator script --- docker/scripts/release.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 docker/scripts/release.sh diff --git a/docker/scripts/release.sh b/docker/scripts/release.sh new file mode 100755 index 0000000..27aad4b --- /dev/null +++ b/docker/scripts/release.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +chmod 777 cache + +echo "Installing Composer packages..." +composer create-project --no-dev + +echo "Installing NPM packages..." +(cd multi && npm install) + +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) +sed -i -E "s/const VERSION = '(.*)';/const VERSION = '${VERSION}';/" main.php +sed -i -E "s/const REVISION = '(.*)';/const REVISION = '${REVISION}';/" main.php +sed -i -E "s/const REVISION_DATE = '(.*)';/const REVISION_DATE = '${REVISION_DATE}';/" main.php + +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