#!/bin/bash

osOutput=`cat /etc/os-release | grep CentOS`
echo "Uninstall ES and delete its DB, conf and logs and install freshly"
if [ "$osOutput" ]
then
	echo $1
	python tools/github_release.py -u $1 -f ${DEPLOY_TAR_WITH_TAG}
	exit 0
else
	echo "Jenkins is not running on CentOS"
	osOutput=`cat /etc/os-release | grep Ubuntu`
fi

if [ "$osOutput" ]
then
	echo "Jenkins is running on Ubuntu, we won't release it on github here."
	exit 0

else
	echo "Jenkins is not running on Ubuntu"
	exit 1
fi
