0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
posthog/bin/upgrade-hobby
Tim Glaser b74c54d117
Add hobby upgrade script (#8289)
* Add hobby upgrade script

* Add hobby upgrade script

* Write env file

* Pull new image
2022-01-27 08:45:17 -08:00

29 lines
659 B
Plaintext
Executable File

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" ]] && source .env || ( 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!"