2019-05-09 06:54:39 +00:00
#!/bin/bash bash
RED = '\033[0;31m'
NC = '\033[0m' # No Color
2020-05-23 22:07:50 +00:00
if [ -z " $1 " ]
then
echo "Missing tag number"
exit 1
fi
if [ -z " $2 " ]
then
echo "Missing version number"
exit 1
fi
2019-12-07 21:20:33 +00:00
echo " Updating git repository $1 / $2 "
2019-05-09 06:54:39 +00:00
git fetch origin
git reset --hard origin/master
2020-01-23 08:26:53 +00:00
if test $( find "./app/db/DBIP/dbip-country-lite-2020-01.mmdb" -mmin +259200)
2019-05-09 06:54:39 +00:00
then
2020-01-23 08:26:53 +00:00
printf " ${ RED } GEO country DB has not been updated for more than 6 months. Go to https://db-ip.com/db/download/ip-to-country-lite to download a newer version ${ NC } \n "
2019-05-09 06:54:39 +00:00
fi
echo 'Starting build...'
2019-12-07 21:20:33 +00:00
docker build --build-arg VERSION = " $2 " --tag appwrite/appwrite:" $1 " .
2019-05-09 06:54:39 +00:00
echo 'Pushing build to registry...'
2019-10-02 13:55:55 +00:00
docker push appwrite/appwrite:" $1 "