From 9e4fb682650957e498a5d0b0912c75c9394ccba0 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 15 Aug 2016 09:45:09 +0200 Subject: [PATCH] Created build script --- build.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 00000000..6b309efc --- /dev/null +++ b/build.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +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}" +cd ${builtcontent} + +# 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 +rm data/database.sqlite +rm data/{cache,log,proxies}/{*,.gitignore} +rm config/params/{*,.gitignore} +rm config/autoload/{*.local.php{,.dist},.gitignore} + +# Compressing file