@@ -15,6 +15,11 @@ print_heading() {
15
15
echo " >"
16
16
}
17
17
18
+ # Run commands in the zammad-railsserver container in a way that also allows the rails stack to start.
19
+ railsserver_run_command () {
20
+ docker compose exec --env=AUTOWIZARD_RELATIVE_PATH=tmp/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-railsserver " $@ "
21
+ }
22
+
18
23
print_heading " wait for zammad to be ready…"
19
24
docker compose wait zammad-init
20
25
docker compose exec zammad-nginx bash -c " curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:8080 | grep 'Zammad'"
28
33
print_heading " Zammad is available via external port :)"
29
34
fi
30
35
36
+ print_heading " Check if elasticsearch index is present…"
37
+ railsserver_run_command rails r " SearchIndexBackend.index_exists?('Ticket') || exit(1)"
38
+ print_heading " Elasticsearch index is present :)"
39
+
40
+ print_heading " Check that translations are present…"
41
+ railsserver_run_command rails r " Translation.any? || exit(1)"
42
+ print_heading " Translations are present :)"
43
+
31
44
print_heading " Execute autowizard…"
32
- 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
45
+ railsserver_run_command bundle exec rake zammad:setup:auto_wizard
33
46
print_heading " Autowizard executed successfully :)"
34
47
35
48
print_heading " Check DB for AutoWizard user"
36
- 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] '
49
+ railsserver_run_command bundle
exec rails r
" p User.find_by(email: '[email protected] ')" | grep
' [email protected] '
37
50
print_heading " Check DB for AutoWizard user successful :)"
38
51
39
52
print_heading " Fill DB with some random data"
40
- 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)"
53
+ railsserver_run_command bundle exec rails r " FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)"
41
54
print_heading " DB fill successful :)"
42
55
43
56
print_heading " Check if the Zammad user can write to FS storage"
44
- docker compose exec zammad-railsserver touch storage/test.txt
57
+ railsserver_run_command touch storage/test.txt
45
58
print_heading " Storage write successful :)"
46
59
47
60
print_heading " Check if the Zammad user can write /tmp"
48
- docker compose exec zammad-railsserver touch tmp/test.txt
61
+ railsserver_run_command touch tmp/test.txt
49
62
print_heading " Tmp write successful :)"
50
63
51
64
print_heading " Check if zammad-backup created an application backup"
0 commit comments