Skip to content

Commit

Permalink
fixup! feat: CI build process for grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
madwort committed Nov 15, 2023
1 parent 7e8fa25 commit 1ec0046
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Test image we imported from previous job works
run: |
SKIP_BUILD=1 just grafana/serve
sleep 5
sleep 10
just grafana/smoke-test || { docker logs grafana_1; exit 1; }
- name: Publish image
Expand Down
33 changes: 33 additions & 0 deletions grafana/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
db:
image: "postgres:16"
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: grafana
ports:
- "6543:5432"
volumes:
- postgres:/var/lib/postgresql/data/

grafana:
# use Dockerfile so that version matches production
build:
dockerfile: Dockerfile
environment:
GF_DATABASE_TYPE: postgres
GF_DATABASE_HOST: db:5432
GF_DATABASE_NAME: grafana
GF_DATABASE_USER: user
GF_DATABASE_PASSWORD: pass
GF_DATABASE_SSL_MODE: disable
depends_on:
- db
ports:
- 3000:3000
volumes:
- grafana:/var/lib/grafana

volumes:
postgres:
grafana:
5 changes: 3 additions & 2 deletions grafana/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ build:
export GITREF=$(git rev-parse --short HEAD)

# build the thing
docker build .
docker compose build grafana

serve:
# Do a basic test with built-in sqlitedb
docker run -p 3000:3000 sha256:c9af59530625894c962e8516cfd44f61161c8dee70fa7e5a7fd78d971c4429b5
# this should use the Dockerfile version, or this test is pointless
docker compose up grafana -d

# run a basic functional smoke test against a running server
smoke-test host="http://localhost:3000/login":
Expand Down

0 comments on commit 1ec0046

Please sign in to comment.