-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fixes #440 - zammad-backup not working with postgres 17 * Improve test to fail for empty DB backups
- Loading branch information
Showing
3 changed files
with
27 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,55 +6,42 @@ | |
set -o errexit | ||
set -o pipefail | ||
|
||
# Send the logs to STDOUT for debugging. | ||
docker compose logs --timestamps --follow & | ||
|
||
echo | ||
echo "wait for zammad to be ready..." | ||
echo | ||
# Print empty lines before and after the heading to find it between the logs. | ||
print_heading() { | ||
echo ">" | ||
echo "> $1" | ||
echo ">" | ||
} | ||
|
||
print_heading "wait for zammad to be ready..." | ||
docker compose wait zammad-init | ||
curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:8080 | grep "Zammad" | ||
print_heading "Success - Zammad is up :)" | ||
|
||
echo | ||
echo "Success - Zammad is up :)" | ||
echo | ||
|
||
echo | ||
echo "Execute autowizard..." | ||
echo | ||
|
||
print_heading "Execute autowizard..." | ||
docker compose exec --env=AUTOWIZARD_RELATIVE_PATH=tmp/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-railsserver bundle exec rake zammad:setup:auto_wizard | ||
print_heading "Autowizard executed successfully :)" | ||
|
||
echo | ||
echo "Autowizard executed successful :)" | ||
echo | ||
|
||
echo | ||
echo "Check DB for AutoWizard user" | ||
echo | ||
|
||
print_heading "Check DB for AutoWizard user" | ||
docker compose exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-railsserver bundle exec rails r "p User.find_by(email: '[email protected]')" | grep '[email protected]' | ||
print_heading "Check DB for AutoWizard user successful :)" | ||
|
||
echo | ||
echo "Check DB for AutoWizard user successfull :)" | ||
echo | ||
|
||
echo | ||
echo "Fill DB with some random data" | ||
echo | ||
|
||
print_heading "Fill DB with some random data" | ||
docker compose exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-railsserver bundle exec rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)" | ||
print_heading "DB fill successful :)" | ||
|
||
echo | ||
echo "DB fill successful :)" | ||
echo | ||
|
||
echo | ||
echo "Check if the Zammad user can write to FS storage" | ||
echo | ||
|
||
print_heading "Check if the Zammad user can write to FS storage" | ||
docker compose exec zammad-railsserver touch storage/test.txt | ||
print_heading "Storage write successful :)" | ||
|
||
print_heading "Check if zammad-backup created an application backup" | ||
docker compose exec zammad-backup sh -c "find /var/tmp/zammad/ -name \"*zammad_files.tar.gz\" | grep ." | ||
print_heading "Application backup successful :)" | ||
|
||
echo | ||
echo "Storage write successful :)" | ||
echo | ||
print_heading "Check if zammad-backup created a database backup" | ||
# Check that the db dump actually has content in the .gz file to catch cases where pg_dump fails. | ||
docker compose exec zammad-backup sh -c "find /var/tmp/zammad/ -name \"*zammad_db.psql.gz\" -size +100k | grep ." | ||
print_heading "Database backup successful :)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters