Skip to content

Commit 9e209ae

Browse files
workflow erstellt zum Bau von Service
1 parent 20aa49d commit 9e209ae

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: ci
2+
on: push
3+
4+
jobs:
5+
Test:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Install Docker Compose
11+
run: |
12+
sudo apt-get update
13+
sudo apt-get install -y docker-compose
14+
- name: Build the stack
15+
run: docker-compose -f project/compose.yaml build
16+
# Container starten
17+
- name: Start services
18+
run: docker-compose -f project/compose.yaml up -d
19+
20+
# Healthcheck / Test
21+
# - name: Run tests
22+
# run: |
23+
# docker ps
24+
# curl -s --retry 10 --retry-connrefused http://localhost:8000/
25+
# - name: Test
26+
# run: docker run --network container:webapp-frontend appropriate/curl -s --retry 10 --retry-connrefused http://localhost:5000/
27+
28+
- name: Wait for frontend on :8000
29+
run: |
30+
PORT=8000
31+
attempts=30
32+
wait_seconds=3
33+
for i in $(seq 1 $attempts); do
34+
if curl -fsSL --retry-all-errors --retry 0 "http://localhost:${PORT}/" >/dev/null 2>&1; then
35+
echo "ready"
36+
exit 0
37+
fi
38+
echo "waiting... ($i)"
39+
sleep $wait_seconds
40+
done
41+
echo "service not ready" >&2
42+
docker-compose -f project/compose.yaml ps || true
43+
docker-compose -f project/compose.yaml logs || true
44+
exit 1
45+
46+
- name: Smoke test
47+
run: curl -fsSL -o /dev/null http://localhost:8000/

0 commit comments

Comments
 (0)