aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/linuxserver/test.sh
blob: d043ce14f91737a519c32e1b626b6bd874ae8e12 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail
shopt -s inherit_errexit lastpipe

script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
script_dir="$( cd -- "$script_dir" && pwd )"
readonly script_dir

build_services() {
    echo ------------------------------------------------------------------
    echo Pull third-party images
    echo ------------------------------------------------------------------
    docker-compose pull wg api

    echo ------------------------------------------------------------------
    echo Build wg-api-web
    echo ------------------------------------------------------------------
    docker-compose build --force-rm --progress plain --pull web

    echo ------------------------------------------------------------------
    echo docker-compose up
    echo ------------------------------------------------------------------
    docker-compose up -d
}

cleanup() {
    echo ------------------------------------------------------------------
    echo Cleaning up
    echo ------------------------------------------------------------------
    docker-compose down -v --remove-orphans
}

main() {
    cd -- "$script_dir"
    trap cleanup EXIT

    build_services
    sleep 3
    "$script_dir/../check_web.sh"
}

main