Skip to content

Commit

Permalink
enhance release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
benIT committed Jan 23, 2018
1 parent e49c8ce commit 0413284
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,36 @@
#script terminate as soon as any command fails
set -e

while [[ $archiveversion == '' ]]
WORKING_DIR='/tmp'
VERSION=$1
DELIVERY_PATH='/vagrant/shared/delivery/'
mkdir -p $DELIVERY_PATH
while [[ $VERSION == '' ]]
do
read -p 'archive version?: ' archiveversion
read -p 'archive version?: ' VERSION
done
cd $WORKING_DIR
rm -rf e-media*
git clone -b $VERSION [email protected]:benIT/e-media.git
cd $WORKING_DIR/e-media

#test
composer install -n
yarn install
php bin/console doctrine:schema:drop --env=test --force
php bin/console doctrine:schema:create --env=test
composer fixtures-test
composer test
php bin/console cache:clear --env=dev
php bin/console cache:clear --env=prod

#build archive
rm -rf web/e-media-data
rm -rf var/cache/*
rm -rf var/logs/*
rm -rf var/sessions/*
rm -rf node_modules
cd .. && tar -czf e-media-$archiveversion.tgz e-media && du -h e-media-$archiveversion.tgz
rm -rf .git
cd .. && tar -czf e-media-$VERSION.tgz e-media && du -h e-media-$VERSION.tgz
mv e-media-$VERSION.tgz $DELIVERY_PATH
echo "delivery available at $DELIVERY_PATH/e-media-$VERSION.tgz"

0 comments on commit 0413284

Please sign in to comment.