Skip to content

Instantly share code, notes, and snippets.

@tyrm
Created January 5, 2023 18:57
Show Gist options
  • Save tyrm/7c105fc170a27a519bb564f6d8e53d61 to your computer and use it in GitHub Desktop.
Save tyrm/7c105fc170a27a519bb564f6d8e53d61 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo
echo "*******************"
echo "* Pull New Images *"
echo "*******************"
echo
docker-compose pull
echo
echo "*********************"
echo "* Delect Containers *"
echo "*********************"
echo
docker-compose down
echo
echo "*********************************"
echo "* Running pre-deploy migrations *"
echo "*********************************"
echo
docker-compose run -e SKIP_POST_DEPLOYMENT_MIGRATIONS=true --rm sidekiq rails db:migrate
echo
echo "***************"
echo "* Clear Cache *"
echo "***************"
echo
docker-compose run -e SKIP_POST_DEPLOYMENT_MIGRATIONS=true --rm sidekiq bin/tootctl cache clear
echo
echo "**********************************"
echo "* Running post-deploy migrations *"
echo "**********************************"
echo
docker-compose run --rm sidekiq rails db:migrate
echo
echo "*************************"
echo "* Create New Containers *"
echo "*************************"
echo
docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment