Skip to content
Snippets Groups Projects
Commit 40f9ef7d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

current version is properly extracted from changelog

parent 968d7e6e
No related branches found
No related tags found
2 merge requests!43412.1.0~beta.2 into master,!429Resolve "Adding new user error"
Pipeline #6623 passed
......@@ -58,18 +58,11 @@ DBSCRIPT_DEST_DIR=$SRC_DIR
MAX_DB_VERSION_FOR_MIGRTION=12.1.0~alpha
source $dbschemadiff
current_version=`cat CHANGELOG |grep minerva |head -1 | cut -f2 -d'(' | cut -f1 -d')'`
echo "Current version: " $current_version
echo "Flyway was introduced in version: " $MAX_DB_VERSION_FOR_MIGRTION
# check if the changelog contains info about new version
tmpVar=`cat debian/template/changelog | grep "minerva ($current_version)"|wc -l`
if [ $tmpVar -eq "0" ]
then
echo "Invalid changelog file. Please modify debian/template/changelog to contain information about current version";
e-n xit 1;
fi
#default connection params (if /etc/minerva/db.properties is not defined)
DB_HOST=`cat persist/src/main/resources/db.properties |grep "uri" |cut -f3 -d"/" |cut -f1 -d":"`
DB_PORT=`cat persist/src/main/resources/db.properties |grep "uri" |cut -f3 -d"/" |cut -f2 -d":"`
......@@ -97,9 +90,6 @@ cd $DEBIAN_DIR
#this should be improved (to include src properly)
dh_make -s --createorig -e piotr.gawron@uni.lu -y -t $ROOT_DIR/debian/template
#echo "minerva_$current_version-1_all.deb science optional" > debian/files
#pwd
#echo "minerva_$current_version-1_all.deb science optional > debian/files"
echo "1.0" > debian/source/format
#remove example files generated by dh_make
......@@ -134,10 +124,7 @@ sed -i -e "1r common.sh" debian/prerm
echo db_0_to_$MAX_DB_VERSION_FOR_MIGRTION".sql" /usr/share/minerva/schema >> debian/install
for version in ${versions[*]}
do
if [ "$version" != "$current_version" ]
then
echo db_"$version"_to_$MAX_DB_VERSION_FOR_MIGRTION".sql" /usr/share/minerva/schema >> debian/install;
fi
echo db_"$version"_to_$MAX_DB_VERSION_FOR_MIGRTION".sql" /usr/share/minerva/schema >> debian/install;
done
#set proper architecture
......
......@@ -10,16 +10,12 @@
# Postcondition:
# * versions is set to the available MINERVA versions (bash array)
# * current_version is set to the latest available version
# * DBSCRIPT_DEST_DIR contains script to initialise the database from any version to the current version
#this variable will contain all available versions of the package
versions=();
#this is current (latest) version of the package
current_version=-1;
#find all available versions
versionCompLte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
......@@ -37,7 +33,6 @@ do
then
versions+=($version);
fi
current_version=$version;
fi
done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment