Skip to content

Commit 5bf51b3

Browse files
authored
Improve CI test script to make external connectivity check optional (#451)
1 parent ea02285 commit 5bf51b3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/tests.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
#
33
# run zammad tests
44
#
55

66
set -o errexit
7-
set -o pipefail
87

98
# Send the logs to STDOUT for debugging.
109
docker compose logs --timestamps --follow &
@@ -16,12 +15,20 @@ print_heading() {
1615
echo ">"
1716
}
1817

19-
print_heading "wait for zammad to be ready..."
18+
print_heading "wait for zammad to be ready"
2019
docker compose wait zammad-init
21-
curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:8080 | grep "Zammad"
20+
docker compose exec zammad-nginx bash -c "curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:8080 | grep 'Zammad'"
2221
print_heading "Success - Zammad is up :)"
2322

24-
print_heading "Execute autowizard..."
23+
# Checking for external connectivity may not always be possible, e.g. in GitLab CI.
24+
if [ -z "$DISABLE_EXTERNAL_TESTS" ]
25+
then
26+
print_heading "Check external connectivity on exposed port…"
27+
curl http://localhost:8080 | grep "Zammad"
28+
print_heading "Zammad is available via external port :)"
29+
fi
30+
31+
print_heading "Execute autowizard…"
2532
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
2633
print_heading "Autowizard executed successfully :)"
2734

0 commit comments

Comments
 (0)