Skip to content

Commit d0782b4

Browse files
authored
doc: add demo environment (#265)
1 parent f068712 commit d0782b4

File tree

5 files changed

+121
-0
lines changed

5 files changed

+121
-0
lines changed

README.adoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,33 @@ Insight reuse pipeline report to provide a visualization per theme such as the s
1717

1818
__Still work in progress__
1919

20+
== Demo
21+
22+
The best way to discover Udash is to try it yourself. There is a docker compose example available in the demo directory.
23+
24+
Deploy Udash with the following steps:
25+
26+
1. Make sure you have Docker and Docker Compose installed.
27+
2. Run `docker compose up -d` in the directory `demo`.
28+
3. Configure your browser to access Udash at `http://localhost:8080`.
29+
4. Run `updatecli udash login "http://localhost" --experimental` to configure Updatecli to upload reports to Udash.
30+
5. Then you can run any updatecli command (apply/diff) to start publishing reports to Udash
31+
32+
INFO: You may have to run `docker compose restart server` if the postgresql database
33+
wasn't ready in time to receive connections when the Udash server started.
34+
35+
Don't worry if you don't have any Updatecli manifest yet, you can still try the demo by using the Updatecli policies used by this Git repository.
36+
For that you need Updatecli and GitHub access token to interact with the GitHub API.
37+
38+
You can run the following commands to configure Updatecli to use the policies defined in this repository:
39+
40+
1. `export GITHUB_TOKEN=<your-github-token>`
41+
2. `export GITHUB_ACTOR=<your-github-username>`
42+
3. `docker login ghcr.io` to authenticate on the GitHub Container Registry for pullling Updatecli policies
43+
4. `updatecli compose diff --experimental` to execute Updatecli policies defined in the file `updatecli-compose.yaml`
44+
45+
46+
2047
== Architecture
2148

2249
=== Requirements

demo/docker-compose.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## How to run this example
2+
#
3+
# 1. Make sure you have Docker and Docker Compose installed.
4+
# 2. Run `docker compose up -d` in the directory containing this file.
5+
# 3. Configure your browser to access the Updatecli dashboard at `http://localhost:8080`.
6+
# 4. Run `updatecli udash login "http://localhost" --experimental`
7+
# 5. Run any updatecli command to publish reports to Udash
8+
#
9+
# INFO: You may have to run `docker compose restart server` if the postgresql database
10+
# wasn't ready to receive connection
11+
#
12+
# For example from the root of this repository, you can run:
13+
# 1. `export GITHUB_TOKEN=<your-github-token>`
14+
# 2. `export GITHUB_ACTOR=<your-github-username>`
15+
# 3. `docker login ghcr.io` to authenticate on the GitHub Container Registry for pullling Updatecli policies
16+
# 4. `updatecli compose diff --experimental` to execute Updatecli policies defined in the file `updatecli-compose.yaml`
17+
18+
version: '3'
19+
services:
20+
db:
21+
image: postgres:17@sha256:8d3be35b184e70d81e54cbcbd3df3c0b47f37d06482c0dd1c140db5dbcc6a808
22+
restart: always
23+
environment:
24+
- POSTGRES_USER=udash
25+
- POSTGRES_PASSWORD=password
26+
- POSTGRES_DB=udash
27+
ports:
28+
- 5432
29+
30+
server:
31+
image: ghcr.io/updatecli/udash:v0.10.0
32+
command: server start
33+
environment:
34+
- GIN_MODE=release
35+
volumes:
36+
- "./udash/config.yaml:/home/udash/.udash/config.yaml"
37+
expose:
38+
- 8080
39+
labels:
40+
- "traefik.enable=true"
41+
- "traefik.http.routers.traefik-server.service=server"
42+
- "traefik.http.services.server.loadbalancer.server.port=8080"
43+
- "traefik.http.routers.traefik-server.rule=PathPrefix(`/api/`)"
44+
45+
front:
46+
image: ghcr.io/updatecli/udash-front:v0.10.1
47+
expose:
48+
- 80
49+
environment:
50+
- VUE_APP_AUTH_ENABLED=false
51+
volumes:
52+
- "./udash-front/config.js:/usr/share/nginx/html/config.js"
53+
- "./udash-front/config.json:/usr/share/nginx/html/config.json"
54+
labels:
55+
- "traefik.enable=true"
56+
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
57+
- "traefik.http.routers.front.service=front"
58+
- "traefik.http.services.front.loadbalancer.server.port=80"
59+
60+
traefik:
61+
image: "traefik:v3.0"
62+
container_name: "traefik"
63+
command:
64+
- "--api.insecure=true"
65+
- "--providers.docker=true"
66+
- "--providers.docker.exposedbydefault=false"
67+
- "--entrypoints.web.address=:80"
68+
ports:
69+
- "80:80"
70+
- "8080:8080"
71+
volumes:
72+
- "/var/run/docker.sock:/var/run/docker.sock:ro"

demo/udash-front/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const config = (() => {
2+
return {
3+
"OAUTH_DOMAIN": "https://oauth.domain",
4+
"OAUTH_CLIENTID": "client_id",
5+
"OAUTH_AUDIENCE": "http://localhost:8080/api"
6+
};
7+
})();

demo/udash-front/config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"OAUTH_DOMAIN": "https://oauth.domain",
3+
"OAUTH_CLIENTID": "client_id",
4+
"OAUTH_AUDIENCE": "http://localhost:8080/api"
5+
}

demo/udash/config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server:
2+
auth:
3+
mode: "none"
4+
# mode: "oauth"
5+
# issuer: "oauth2 provider"
6+
# audience: "http://udash.localhost"
7+
8+
database:
9+
migrationdisabled: false
10+
uri: postgres://udash:password@db:5432/udash?sslmode=disable

0 commit comments

Comments
 (0)