Skip to content

Commit 10b2193

Browse files
Add Dashboard app (#246)
Add Dashboard app Add GitHub workflows Add HTTP API transport layer Add Dockerfile with web server
1 parent 482a128 commit 10b2193

File tree

37 files changed

+1261
-287
lines changed

37 files changed

+1261
-287
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint & build
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "npm"
25+
- run: npm ci
26+
- run: npm run lint
27+
- run: npm run build:prod

.github/workflows/release.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Publish release
2+
3+
# Controls when the workflow will run
4+
on:
5+
workflow_dispatch:
6+
release:
7+
types: [released]
8+
9+
# permissions are needed if pushing to ghcr.io
10+
permissions:
11+
packages: write
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-node@v3
21+
with:
22+
cache: npm
23+
node-version-file: ".nvmrc"
24+
- run: npm ci
25+
- run: npm run lint
26+
- run: npm run build:prod:web
27+
28+
- uses: actions/upload-artifact@v3
29+
with:
30+
name: build
31+
path: dist/
32+
33+
- uses: actions/upload-artifact@v3
34+
with:
35+
name: nginx-config
36+
path: nginx.conf.template
37+
38+
- uses: actions/upload-artifact@v3
39+
with:
40+
name: dockerfile
41+
path: Dockerfile
42+
43+
download:
44+
name: Build and push Docker image
45+
needs: [build]
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/download-artifact@v3
50+
with:
51+
name: jaeger-build
52+
path: build
53+
54+
- uses: actions/download-artifact@v3
55+
with:
56+
name: nginx-config
57+
58+
- uses: actions/download-artifact@v3
59+
with:
60+
name: dockerfile
61+
62+
# https://github.com/docker/setup-qemu-action
63+
- name: Set up QEMU
64+
uses: docker/setup-qemu-action@v2
65+
66+
# https://github.com/docker/setup-buildx-action
67+
- name: Set up Docker Buildx
68+
id: buildx
69+
uses: docker/setup-buildx-action@v2
70+
71+
- name: Login to Docker Hub
72+
uses: docker/login-action@v2
73+
with:
74+
username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }}
75+
password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }}
76+
77+
- name: Docker meta
78+
id: metadata # you'll use this in the next step
79+
uses: docker/metadata-action@v4
80+
with:
81+
# list of Docker images to use as base name for tags
82+
images: digmaai/digma-ui
83+
# Docker tags based on the following events/attributes
84+
tags: |
85+
type=schedule
86+
type=ref,event=branch
87+
type=ref,event=pr
88+
type=match,pattern=v(.*),group=1
89+
type=semver,pattern={{version}}
90+
type=semver,pattern={{major}}.{{minor}}
91+
type=semver,pattern={{major}}
92+
type=sha
93+
# set latest tag for main branch
94+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
95+
96+
- name: Build and push
97+
uses: docker/build-push-action@v4
98+
with:
99+
context: .
100+
file: ./Dockerfile
101+
platforms: linux/amd64,linux/arm64
102+
push: ${{ github.event_name != 'pull_request' }}
103+
tags: ${{ steps.metadata.outputs.tags }}
104+
labels: ${{ steps.metadata.outputs.labels }}

.storybook/preview-body.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
window.assetsRefreshInterval;
1717
window.assetsSearch = true;
1818

19+
window.dashboardEnvironment = "SAMPLE_ENV";
20+
window.dashboardRefreshInterval;
21+
1922
window.documentationPage = "run-digma-with-docker";
2023

2124
window.insightsRefreshInterval;

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM nginx:1.25.0
2+
3+
COPY ./dist/ /usr/share/nginx/html/
4+
COPY ./nginx.conf.template /etc/nginx/conf.d/default.conf.template
5+
RUN rm /usr/share/nginx/html/index.html
6+
7+
CMD ["/bin/sh" , "-c" , "envsubst '${PLUGIN_API_URL}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"]

assets/documentation/index.ejs

Lines changed: 0 additions & 36 deletions
This file was deleted.

assets/assets/index.ejs renamed to assets/index.ejs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
window.isDigmaEngineRunning;
2929
window.isDockerInstalled;
3030
window.isDockerComposeInstalled;
31-
32-
window.assetsRefreshInterval;
33-
window.assetsSearch;
31+
<% for (var i = 0; i < environmentVariables.length; i++) { %>
32+
window.<%= environmentVariables[i] %>;<% } %>
3433
</script>
35-
<script src="/index.js"></script>
34+
<script src="./index.js"></script>
3635
</body>
3736
</html>

assets/troubleshooting/index.ejs renamed to assets/index.web.ejs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,10 @@
1515
<div id="root"></div>
1616
<!-- Environment variables -->
1717
<script>
18-
window.digmaApiUrl;
19-
window.theme;
20-
window.platform;
21-
window.ide;
22-
window.mainFont;
23-
window.codeFont;
24-
window.isJaegerEnabled;
25-
window.userEmail;
26-
window.isObservabilityEnabled;
27-
window.isDigmaEngineInstalled;
28-
window.isDigmaEngineRunning;
29-
window.isDockerInstalled;
30-
window.isDockerComposeInstalled;
18+
window.platform = "Web";
19+
<% for (var i = 0; i < environmentVariables.length; i++) { %>
20+
window.<%= environmentVariables[i] %>;<% } %>
3121
</script>
32-
<script src="/index.js"></script>
22+
<script src="./index.js"></script>
3323
</body>
3424
</html>

assets/insights/index.ejs

Lines changed: 0 additions & 36 deletions
This file was deleted.

assets/installationWizard/index.ejs

Lines changed: 0 additions & 37 deletions
This file was deleted.

assets/notifications/index.ejs

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)