Skip to content

Commit

Permalink
[TASK] Update TER release script
Browse files Browse the repository at this point in the history
  • Loading branch information
elbebass committed Aug 30, 2021
1 parent 5f674d5 commit 7a80451
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Build/release.sh
@@ -1,19 +1,17 @@
#!/usr/bin/env bash

NEW_RELEASE=$1
LATEST_RELEASE=$(git tag --sort=committerdate --list | tail -1)
DIR=$(pwd)


if [ ! -z "${NEW_RELEASE}" ]; then
if [ -n "${NEW_RELEASE}" ]; then
NEW_RELEASE=v${NEW_RELEASE}
echo "Create release of version ${NEW_RELEASE}"
else
echo "No version defined. Exit."
exit 1;
fi

EXISTS=$(git describe --contains ${NEW_RELEASE} 2>&1)
EXISTS=$(git describe --contains "${NEW_RELEASE}" 2>&1)

if [[ "$EXISTS" == "$NEW_RELEASE" ]]; then
echo "Release already exists. Exit."
Expand All @@ -22,12 +20,19 @@ fi

if [ -d "$DIR" ]; then

if [ -d "$DIR/Libraries" ]; then
echo "Installing composer dependencies..."
cd "$DIR/Libraries" || exit
composer install --no-dev --no-progress --quiet
echo "Done."
fi

echo "Create git tag"
cd $DIR
git tag $NEW_RELEASE
cd "$DIR" || exit
git tag "$NEW_RELEASE"

echo "Archive repository..."
zip -r "../bm_image_gallery_${1}.zip" * -x \*.git\* Build/\* Documentation/\* Tests/\* php-cs-fixer.php codecov.yml LICENSE.txt README.md
zip -r "../bm_image_gallery_${1}.zip" ./* -x \*.git\* Build/\* Documentation/\* Tests/\* php-cs-fixer.php codecov.yml LICENSE.txt README.md
echo "Done."

echo "Please add and push the git tag: gp --tags"
Expand Down

0 comments on commit 7a80451

Please sign in to comment.