-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (101 loc) · 3.59 KB
/
observability-docker.yml
File metadata and controls
112 lines (101 loc) · 3.59 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: ci-build
on:
push:
branches: [main]
tags:
- "v*.*.*" # e.g., v0.1.1
paths:
- "observability/**"
- ".github/workflows/observability**"
pull_request:
paths:
- "observability/**"
- ".github/workflows/observability**"
jobs:
docker:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.repository == 'CogStack/cogstack-platform'
strategy:
matrix: # This should be replaced with Docker Bake instead
include:
- name: prometheus
context: observability/prometheus
dockerfile: observability/prometheus/Dockerfile.prometheus
image: cogstacksystems/cogstack-observability-prometheus
- name: blackbox
context: observability/prometheus
dockerfile: observability/prometheus/Dockerfile.blackbox
image: cogstacksystems/cogstack-observability-blackbox-exporter
- name: grafana
context: observability/grafana
dockerfile: observability/grafana/Dockerfile
image: cogstacksystems/cogstack-observability-grafana
- name: traefik
context: observability/traefik
dockerfile: observability/traefik/Dockerfile
image: cogstacksystems/cogstack-observability-traefik
- name: alloy
context: observability/grafana-alloy
dockerfile: observability/grafana-alloy/Dockerfile
image: cogstacksystems/cogstack-observability-alloy
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
# Include all default tags
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ matrix.image}}:buildcache
cache-to: type=registry,ref=${{ matrix.image}}:buildcache,mode=max
test-observability-quickstart-scripts:
runs-on: ubuntu-latest
name: Test observability Quickstart scripts
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: pip
- name: Install Python dependencies
run: pip install -r observability/test/requirements.txt
- name: Run Simple quickstart test
run: |
echo "🧪 Running Simple quickstart test..."
bash observability/test/test-quickstart.sh
- name: Report test result
if: always()
run: |
if [ $? -eq 0 ]; then
echo "✅ quickstart test PASSED"
else
echo "❌ quickstart test FAILED"
exit 1
fi