forked from elifesciences/journal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmoke_tests.sh
executable file
·31 lines (25 loc) · 931 Bytes
/
smoke_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
. /opt/smoke.sh/smoke.sh
hostname="${1:-$(hostname)}"
port="${2:-80}"
# retrieve manifest from container, if present
if which docker && docker container ls -a | grep journal_assets_builder_1; then
docker cp journal_assets_builder_1:/build/rev-manifest.json build/
fi
function from_manifest {
jq -r ".[\"${1}\"]" < build/rev-manifest.json
}
smoke_url_ok "$hostname:$port/favicon.ico"
smoke_url_ok "$hostname:$port/$(from_manifest assets/favicons/manifest.json)"
smoke_url_ok "$hostname:$port/$(from_manifest assets/patterns/css/all.css)"
smoke_url_ok "$hostname:$port/$(from_manifest assets/images/banners/[email protected])"
smoke_url_ok "$hostname:$port/ping"
smoke_assert_body "pong"
if [ "$ENVIRONMENT_NAME" != "ci" ] && [ "$ENVIRONMENT_NAME" != "dev" ]
then
set -e
retry "./status_test.sh $hostname $port" 3 5
set +e
smoke_url_ok "$hostname:$port/"
fi
smoke_report