Skip to content

Docker Compose Test (Netbox) #59

Docker Compose Test (Netbox)

Docker Compose Test (Netbox) #59

name: "Docker Compose Test (Netbox)"
on:
pull_request:
branches: master
push:
branches: master
schedule:
- cron: "0 8 * * *"
env:
TARGET_SERVICE: netbox
TARGET_TIMEOUT: 300
jobs:
test:
strategy:
matrix:
platform: [ ubuntu-24.04 , ubuntu-24.04-arm ]
runs-on: ${{ matrix.platform }}
steps:
-
name: "Git: Checkout"
uses: actions/checkout@v4
-
name: "Service: Setup"
run: |
cp .github/workflows/config/meta.override.yml "${TARGET_SERVICE}/"
cp .github/workflows/config/meta.override.yml "traefik/"
-
name: "Service: Start"
run: |
./comp up --skip-prereqs --labels ignore ${TARGET_SERVICE}
-
name: "Service: Wait"
run: |
cd ${TARGET_SERVICE} ; cat .env env/*
sleep ${TARGET_TIMEOUT}s
-
name: "Service: Test"
run: |
if ! ./comp status --skip-prereqs ${TARGET_SERVICE}; then
docker ps
cd ${TARGET_SERVICE} ; docker compose logs
exit 1
fi
-
name: "Service: Restart with Traefik"
run: |
./comp down,up ${TARGET_SERVICE}
-
name: "Service: Wait"
run: |
sleep ${TARGET_TIMEOUT}s
-
name: "Service: Test with Traefik"
run: |
if ! ./comp status ${TARGET_SERVICE} ; then
docker ps
cd ${TARGET_SERVICE} ; docker compose logs
cd traefik ; docker compose logs
exit 1
fi
cd traefik
docker compose exec -T traefik wget --spider --no-check-certificate https://localhost:9443/netbox/ \
|| (docker ps ; docker compose logs ; cd ../${TARGET_SERVICE} ; docker compose logs ; exit 1)