Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/dis-console-ui-lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Dis Console UI Lint and Test

on:
push:
branches:
- main
paths:
- services/dis-console-ui/**
- .github/workflows/dis-console-ui-lint-test.yml
pull_request:
branches:
- main
paths:
- services/dis-console-ui/**
- .github/workflows/dis-console-ui-lint-test.yml

permissions:
contents: read

jobs:
checks:
name: Type-check, lint, test, build
runs-on: ubuntu-latest
defaults:
run:
working-directory: services/dis-console-ui
steps:
- name: Clone the code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Type-check
run: bun run typecheck

- name: Lint
run: bun run lint

- name: Test
run: bun run test

- name: Build
run: bun run build

e2e:
name: Run e2e on Kind
needs: checks
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: services/dis-console-ui
env:
CONTAINER_TOOL: docker
steps:
- name: Clone the code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Create Kind cluster
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
with:
cluster_name: dis-console-ui-test-e2e

# KIND_KUBECONFIG= (empty) makes the Makefile use the ambient kubeconfig
# from kind-action; its default is a dedicated file so local runs never
# touch the developer's current context.
- name: Build image, deploy to Kind, smoke-test
run: make e2e KIND_KUBECONFIG=
36 changes: 36 additions & 0 deletions .github/workflows/dis-console-ui-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Scan/Release dis-console-ui Image

on:
pull_request:
branches:
- main
paths:
- .github/workflows/dis-console-ui-release.yml
- services/dis-console-ui/**
- .github/workflows/reusable-image-scan-and-release-ghcr.yml
push:
branches:
- main
paths:
- .github/workflows/dis-console-ui-release.yml
- services/dis-console-ui/**
- .github/workflows/reusable-image-scan-and-release-ghcr.yml
tags:
- "dis-console-ui-v*"
workflow_dispatch: {}

permissions:
contents: read
packages: write
id-token: write

jobs:
build-and-release-image:
name: Build, scan and release
uses: ./.github/workflows/reusable-image-scan-and-release-ghcr.yml
with:
release_latest: true
image_name: dis-console-ui
tag_prefix: dis-console-ui-v
platforms: "linux/amd64"
workdir: ./services/dis-console-ui
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"services/dis-vault-operator": "1.4.9",
"services/lakmus": "1.1.6",
"services/dis-console": "1.7.2",
"services/dis-console-ui": "0.1.0",
"infrastructure/images/azure-devops-agent": "1.2.9",
"infrastructure/images/gh-runner": "0.9.1",
"infrastructure/images/k6-action": "0.1.2",
Expand Down
69 changes: 69 additions & 0 deletions deploy/admin/base/dis-console-ui-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: dis-console-ui
namespace: product-dis
labels:
app: dis-console-ui
spec:
replicas: 1
selector:
matchLabels:
app: dis-console-ui
template:
metadata:
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
labels:
app: dis-console-ui
spec:
automountServiceAccountToken: false
enableServiceLinks: false
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: dis-console-ui
image: ghcr.io/altinn/altinn-platform/dis-console-ui:latest
ports:
- name: http
containerPort: 8080
env:
- name: DIS_CONSOLE_API
value: http://dis-console
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
requests:
cpu: 10m
memory: 32Mi
limits:
memory: 128Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
---
apiVersion: v1
kind: Service
metadata:
name: dis-console-ui
namespace: product-dis
labels:
app: dis-console-ui
spec:
type: ClusterIP
selector:
app: dis-console-ui
ports:
- name: http
port: 80
targetPort: http
1 change: 1 addition & 0 deletions deploy/admin/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ resources:
- dis-console-agent-database.yaml
- dis-console-agent-rbac.yaml
- dis-console-agent-deployment.yaml
- dis-console-ui-deployment.yaml
4 changes: 4 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"release-type": "simple",
"component": "dis-console"
},
"services/dis-console-ui": {
"release-type": "node",
"component": "dis-console-ui"
},
"infrastructure/images/azure-devops-agent": {
"release-type": "simple",
"component": "azdevops-agent",
Expand Down
3 changes: 2 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
{
"matchManagers": [
"terraform",
"gomod"
"gomod",
"npm"
],
"groupName": "{{manager}} non-major dependencies",
"matchUpdateTypes": [
Expand Down
9 changes: 9 additions & 0 deletions services/dis-console-ui/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
coverage
.git
.gitignore
.env
.env.*
.kind-*.kubeconfig
*.log
16 changes: 16 additions & 0 deletions services/dis-console-ui/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Use the bundled mock fleet data. This is the default for the POC so the UI runs
# standalone without a deployed dis-console server.
VITE_USE_MOCK=true

# Base URL of a deployed dis-console `server` fleet API. Only used when
# VITE_USE_MOCK=false. Leave empty to call the same origin that serves the UI.
# Example: https://dis-console.example.internal
VITE_API_BASE_URL=

# Azure AD tenant for Azure Portal deep-links (portal.azure.com/#@<tenant>/resource/...).
# Leave empty to let the Portal resolve the tenant itself.
VITE_AZURE_PORTAL_TENANT=

# Base URL of the shared Grafana instance; enables the Logs/Metrics links on a
# syncroot's Observability tab. Example: https://grafana.example.internal
VITE_GRAFANA_BASE_URL=
12 changes: 12 additions & 0 deletions services/dis-console-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules/
dist/
dist-ssr/
coverage/
*.local
.env
.env.*
!.env.example
*.log
.DS_Store
.vite/
.kind-*.kubeconfig
1 change: 1 addition & 0 deletions services/dis-console-ui/.trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Add CVE IDs here (one per line) to ignore in the Trivy image scan.
Loading
Loading