0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 18:26:15 +01:00
posthog/bin/upgrade-hobby

30 lines
675 B
Plaintext
Raw Normal View History

set -e
echo "Upgrading PostHog. This will cause a few minutes of downtime."
read -r -p "Do you want to upgarde PostHog? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
echo "OK!"
else
exit
fi
[[ -f ".env" ]] && export $(cat .env | xargs) || ( echo "No .env file found. Please create it with POSTHOG_SECRET and DOMAIN set." && exit 1)
docker-compose stop
cd posthog
git pull
cd ../
rm -f docker-compose.yml
cp posthog/docker-compose.hobby.yml docker-compose.yml.tmpl
envsubst < docker-compose.yml.tmpl > docker-compose.yml
rm docker-compose.yml.tmpl
docker-compose pull
sudo -E docker-compose up -d
echo "PostHog upgraded successfully!"