2017-07-14 17:05:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-07-16 12:55:01 +00:00
|
|
|
DC_SCRIPT=./scripts/example/dc-example.sh
|
|
|
|
|
|
|
|
run_services() {
|
|
|
|
$DC_SCRIPT up -d redis openldap
|
|
|
|
sleep 2
|
|
|
|
$DC_SCRIPT up -d authelia nginx nginx-tests
|
|
|
|
sleep 3
|
|
|
|
}
|
|
|
|
|
2017-07-14 17:05:42 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "Make sure services are not already running"
|
2017-07-16 12:55:01 +00:00
|
|
|
$DC_SCRIPT down
|
|
|
|
|
|
|
|
|
|
|
|
# Prepare & run integration tests
|
2017-07-14 17:05:42 +00:00
|
|
|
|
|
|
|
echo "Prepare nginx-test configuration"
|
|
|
|
cat example/nginx/nginx.conf | sed 's/listen 443 ssl/listen 8080 ssl/g' | dd of="test/integration/nginx.conf"
|
|
|
|
|
|
|
|
echo "Build services images..."
|
2017-07-16 12:55:01 +00:00
|
|
|
$DC_SCRIPT build
|
2017-07-14 17:05:42 +00:00
|
|
|
|
|
|
|
echo "Start services..."
|
2017-07-16 12:55:01 +00:00
|
|
|
run_services
|
2017-07-14 17:05:42 +00:00
|
|
|
docker ps -a
|
|
|
|
|
|
|
|
echo "Display services logs..."
|
2017-07-16 12:55:01 +00:00
|
|
|
$DC_SCRIPT logs redis
|
|
|
|
$DC_SCRIPT logs openldap
|
|
|
|
$DC_SCRIPT logs nginx
|
|
|
|
$DC_SCRIPT logs nginx-tests
|
|
|
|
$DC_SCRIPT logs authelia
|
2017-07-14 17:05:42 +00:00
|
|
|
|
|
|
|
echo "Check number of services"
|
2017-07-16 12:55:01 +00:00
|
|
|
./scripts/example/check-services.sh
|
2017-07-14 17:05:42 +00:00
|
|
|
|
|
|
|
echo "Run integration tests..."
|
2017-07-16 12:55:01 +00:00
|
|
|
$DC_SCRIPT run --rm integration-tests
|
2017-07-14 17:05:42 +00:00
|
|
|
|
|
|
|
echo "Shutdown services..."
|
2017-07-16 12:55:01 +00:00
|
|
|
$DC_SCRIPT down
|
|
|
|
|
|
|
|
# Prepare & test example from end user perspective
|
|
|
|
|
|
|
|
echo "Start services..."
|
|
|
|
run_services
|
|
|
|
|
|
|
|
./node_modules/.bin/mocha --compilers ts:ts-node/register --recursive test/system
|
|
|
|
|
|
|
|
$DC_SCRIPT down
|
|
|
|
|