-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.32 KB
/
docker_test.yml
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
name: Test Docker Compose Run
on:
push:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
- name: start docker
working-directory: ./docker_run
run: |
docker compose create
docker compose up -d
echo "waiting for docker system to start"
sleep 5
docker compose stop prometheusdbexporter
docker compose start
#sleep 10
echo "Docker system presumably started ..."
- name: Check the image works fine
run: |
docker ps
#docker cp docker_run-prometheusdbexporter-1:/usr/local/tomcat/logs ./test_container_logs
# docker exec "docker_run-prometheusdbexporter-1" apt-get update -y
# docker exec "docker_run-prometheusdbexporter-1" apt-get install -y iputils-ping
# docker exec "docker_run-prometheusdbexporter-1" ping -c 4 database
#cat ./test_container_logs/*
wget -O test.prom http://localhost:8080/PrometheusDbExporter/metrics
cat test.prom
- name: stop docker
working-directory: ./docker_run
run: |
docker compose down