Skip to content

Commit

Permalink
Uninstall Docker Compose v1 from CI so it's not used for tests (#2114)
Browse files Browse the repository at this point in the history
* remove docker compose v1

* use scripts for integration tests

* use $dc for tests

* move removing dc v1 up
  • Loading branch information
hubertdeng123 committed May 2, 2023
1 parent 9f191ab commit 723abc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
# Always remove `docker compose` support as that's the newer version
# and comes installed by default nowadays.
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "${{ matrix.compose_path }}/docker-compose"
sudo mkdir -p "${{ matrix.compose_path }}"
sudo curl -L https://github.com/docker/compose/releases/download/${{ matrix.compose_version }}/docker-compose-`uname -s`-`uname -m` -o "${{ matrix.compose_path }}/docker-compose"
Expand Down
10 changes: 5 additions & 5 deletions _integration-test/ensure-backup-restore-works.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ echo "Creating backup..."
touch $(pwd)/sentry/backup.json
chmod 666 $(pwd)/sentry/backup.json
# Command here matches exactly what we have in our docs https://develop.sentry.dev/self-hosted/backup/#backup
docker-compose run -v $(pwd)/sentry:/sentry-data/backup --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export /sentry-data/backup/backup.json
$dc run -v $(pwd)/sentry:/sentry-data/backup --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export /sentry-data/backup/backup.json
# Check to make sure there is content in the file
if [ ! -s "$(pwd)/sentry/backup.json" ]; then
echo "Backup file is empty"
exit 1
fi

# Bring postgres down and recreate the docker volume
docker-compose stop postgres
$dc stop postgres
sleep 5
docker-compose rm -f -v postgres
$dc rm -f -v postgres
docker volume rm sentry-postgres
export SKIP_USER_CREATION=1
source install/create-docker-volumes.sh
source install/set-up-and-migrate-database.sh
docker-compose up -d
$dc up -d

echo "Importing backup..."
docker-compose run --rm -T web import /etc/sentry/backup.json
$dc run --rm -T web import /etc/sentry/backup.json

rm $(pwd)/sentry/backup.json

0 comments on commit 723abc0

Please sign in to comment.