Skip to content

Commit

Permalink
Fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
xacobofg committed Oct 5, 2020
1 parent fa7de1b commit c380427
Showing 1 changed file with 59 additions and 66 deletions.
125 changes: 59 additions & 66 deletions tools/make_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
# https://github.com/ticgal/taskdrop
# -------------------------------------------------------------------------
# LICENSE
# This file is part of the Task&drop plugin.
# Task&drop plugin is free software; you can redistribute it and/or modify
# This file is part of the taskdrop plugin.
# taskdrop plugin is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# Task&drop plugin is distributed in the hope that it will be useful,
# taskdrop plugin is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with Task&drop. If not, see <http://www.gnu.org/licenses/>.
# along with taskdrop. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
# @package Task&drop
# @package taskdrop
# @author TICgal
# @copyright Copyright (c) 2018-2019 TICgal
# @license AGPL License 3.0 or (at your option) any later version
Expand All @@ -28,96 +28,89 @@
# @since 2018
# --------------------------------------------------------------------------

PLUGINNAME="taskdrop"

if [ ! "$#" -eq 2 ]
then
echo "Usage $0 fi_git_dir release";
exit ;
echo "Usage $0 fi_git_dir release"
exit
fi

read -p "Are translations up to date? [Y/n] " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi

INIT_DIR=$1;
RELEASE=$2;
INIT_DIR=$1
RELEASE=$2

# remove old tmp files
if [ ! e $/tmp/$PLUGINNAME ]
then
echo "Deleting temp directory"
rm -rf /tmp/$PLUGINNAME
fi

# test glpi_cvs_dir
if [ ! -e $INIT_DIR ]
# test plugin_cvs_dir
if [ ! -e $INIT_DIR ]
then
echo "$1 does not exist";
exit ;
echo "$1 does not exist"
exit
fi

INIT_PWD=$PWD;

if [ -e /tmp/actualtime ]
if [ -e /tmp/$PLUGINNAME ]
then
echo "Delete existing temp directory";
\rm -rf /tmp/actualtime;
echo "Delete existing temp directory"
rm -rf /tmp/$PLUGINNAME
fi

echo "Copy to /tmp directory";
git checkout-index -a -f --prefix=/tmp/actualtime/
echo "Copy to /tmp directory"
git checkout-index -a -f --prefix=/tmp/$PLUGINNAME/

echo "Move to this directory";
cd /tmp/actualtime;
echo "Move to this directory"
cd /tmp/$PLUGINNAME

echo "Check version"
if grep --quiet $RELEASE setup.php; then
echo "$RELEASE found in setup.php, OK."
echo "$RELEASE found in setup.php, OK."
else
echo "$RELEASE has not been found in setup.php. Exiting."
exit 1;
echo "$RELEASE has not been found in setup.php. Exiting."
exit 1
fi
if grep --quiet $RELEASE actualtime.xml; then
echo "$RELEASE found in actualtime.xml, OK."
else
echo "$RELEASE has not been found in actualtime.xml. Exiting."
exit 1;
fi

echo "Set version and official release"
sed \
-e 's/"PLUGIN_ACTUALTIME_OFFICIAL_RELEASE", "0"/"PLUGIN_ACTUALTIME_OFFICIAL_RELEASE", "1"/' \
-e 's/ SNAPSHOT//' \
-i '' setup.php

#echo "Minify stylesheets and javascripts"
#$INIT_PWD/vendor/bin/robo minify

echo "Compile locale files"
./tools/update_mo.pl
./tools/generate_locales.sh

echo "Delete various scripts and directories"
\rm -rf vendor;
\rm -rf RoboFile.php;
\rm -rf tools;
\rm -rf phpunit;
\rm -rf tests;
\rm -rf .gitignore;
\rm -rf .travis.yml;
\rm -rf .coveralls.yml;
\rm -rf phpunit.xml.dist;
\rm -rf composer.json;
\rm -rf composer.lock;
\rm -rf .composer.hash;
\rm -rf ISSUE_TEMPLATE.md;
\rm -rf PULL_REQUEST_TEMPLATE.md;
\rm -rf .tx;
\rm -rf actualtime.xml;
\rm -rf screenshots;
\find pics/ -type f -name "*.eps" -exec rm -rf {} \;

echo "Creating tarball";
cd ..;
tar czf "actualtime-$RELEASE.tar.tgz" actualtime
rm -rf vendor
rm -rf RoboFile.php
rm -rf tools
rm -rf phpunit
rm -rf tests
rm -rf .gitignore
rm -rf .travis.yml
rm -rf .coveralls.yml
rm -rf phpunit.xml.dist
rm -rf composer.json
rm -rf composer.lock
rm -rf .composer.hash
rm -rf ISSUE_TEMPLATE.md
rm -rf PULL_REQUEST_TEMPLATE.md
rm -rf .tx
rm -rf taskdrop.xml
rm -rf screenshots

echo "Creating tarball"
cd ..
tar czf "$PLUGINNAME-$RELEASE.tar.tgz" $PLUGINNAME

cd $INIT_PWD;

echo "Deleting temp directory";
\rm -rf /tmp/actualtime;
echo "Deleting temp directory"
rm -rf /tmp/$PLUGINNAME

echo "The Tarball is in the /tmp directory";
echo "The Tarball is in the /tmp directory"

0 comments on commit c380427

Please sign in to comment.