2016-08-15 10:45:09 +03:00
|
|
|
#!/usr/bin/env bash
|
2016-08-15 10:52:44 +03:00
|
|
|
set -e
|
2016-08-15 10:45:09 +03:00
|
|
|
|
2016-08-15 11:18:13 +03:00
|
|
|
if [ "$#" -ne 1 ]; then
|
|
|
|
echo "Usage:" >&2
|
|
|
|
echo " $0 {version}" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
version=$1
|
2016-08-15 10:45:09 +03:00
|
|
|
builtcontent=$(readlink -f '../shlink_build_tmp')
|
|
|
|
projectdir=$(pwd)
|
|
|
|
|
|
|
|
# Copy project content to temp dir
|
|
|
|
echo 'Copying project files...'
|
|
|
|
rm -rf "${builtcontent}"
|
|
|
|
mkdir "${builtcontent}"
|
|
|
|
cp -R "${projectdir}"/* "${builtcontent}"
|
2016-08-15 11:03:17 +03:00
|
|
|
cd "${builtcontent}"
|
2016-08-15 10:45:09 +03:00
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
rm -r vendor
|
|
|
|
rm composer.lock
|
|
|
|
composer self-update
|
|
|
|
composer install --no-dev --optimize-autoloader
|
|
|
|
|
|
|
|
# Delete development files
|
|
|
|
echo 'Deleting dev files...'
|
|
|
|
rm build.sh
|
|
|
|
rm CHANGELOG.md
|
|
|
|
rm composer.*
|
|
|
|
rm LICENSE
|
|
|
|
rm php*
|
|
|
|
rm README.md
|
|
|
|
rm -r build
|
2016-08-15 11:03:17 +03:00
|
|
|
rm -f data/database.sqlite
|
2016-08-16 12:51:05 +03:00
|
|
|
rm -rf data/{cache,log,proxies}/{*,.gitignore}
|
|
|
|
rm -rf config/params/{*,.gitignore}
|
|
|
|
rm -rf config/autoload/{{,*.}local.php{,.dist},.gitignore}
|
2016-08-15 10:45:09 +03:00
|
|
|
|
|
|
|
# Compressing file
|
2016-08-16 12:51:05 +03:00
|
|
|
rm -f "${projectdir}"/build/shlink_${version}_dist.zip
|
2016-08-21 20:16:06 +03:00
|
|
|
zip -ry "${projectdir}"/build/shlink_${version}_dist.zip .
|
2016-08-15 11:18:13 +03:00
|
|
|
rm -rf "${builtcontent}"
|