Skip to content

Commit eb037d8

Browse files
Merge branch 'dev' into feat/client-v1
2 parents 544a6ba + 4ed8d2c commit eb037d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+703
-219
lines changed

.github/workflows/api_validation.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Node.js
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: '18'
24+
node-version: '22'
2525
cache: 'npm'
2626

2727
- name: Install Redocly CLI
@@ -48,13 +48,13 @@ jobs:
4848
- name: Setup Node.js
4949
uses: actions/setup-node@v4
5050
with:
51-
node-version: '18'
51+
node-version: '22'
5252
cache: 'npm'
5353

5454
- name: Setup Python
5555
uses: actions/setup-python@v4
5656
with:
57-
python-version: '3.12'
57+
python-version: '3.13'
5858
cache: 'pip'
5959

6060
- name: Install OpenAPI Generator
@@ -89,7 +89,7 @@ jobs:
8989
- name: Setup Node.js
9090
uses: actions/setup-node@v4
9191
with:
92-
node-version: '18'
92+
node-version: '22'
9393
cache: 'npm'
9494

9595
- name: Install Pact CLI
@@ -116,7 +116,7 @@ jobs:
116116
- name: Setup Node.js
117117
uses: actions/setup-node@v4
118118
with:
119-
node-version: '18'
119+
node-version: '22'
120120
cache: 'npm'
121121

122122
- name: Install Redoc CLI
@@ -135,4 +135,4 @@ jobs:
135135
uses: JamesIves/github-pages-deploy-action@v4
136136
with:
137137
folder: docs
138-
branch: gh-pages
138+
branch: gh-pages

.github/workflows/build_docker.yml

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,59 @@ on:
99
- main
1010

1111
jobs:
12+
generate_api_code:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Java
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '21'
22+
distribution: 'temurin'
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '22'
28+
cache: 'npm'
29+
30+
- name: Setup Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.13'
34+
cache: 'pip'
35+
36+
- name: Install OpenAPI Generator
37+
run: |
38+
npm install -g @openapitools/openapi-generator-cli
39+
pip install openapi-python-client
40+
41+
- name: Generate Code
42+
run: |
43+
chmod +x api/scripts/gen-all.sh
44+
./api/scripts/gen-all.sh
45+
46+
- name: Upload entire repository as artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: full-repository
50+
path: .
51+
1252
test-java:
1353
name: Run Java Tests
54+
needs: generate_api_code
1455
runs-on: ubuntu-latest
1556
strategy:
1657
matrix:
17-
service: [server, user-svc, concept-svc]
58+
service: [gateway, user-svc, concept-svc]
1859
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
60+
- name: Download full repository artifact
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: full-repository
64+
path: .
2165

2266
- uses: actions/setup-java@v4
2367
with:
@@ -32,15 +76,19 @@ jobs:
3276

3377
test-python:
3478
name: Run Python Tests
79+
needs: generate_api_code
3580
runs-on: ubuntu-latest
3681
steps:
37-
- name: Checkout
38-
uses: actions/checkout@v4
82+
- name: Download full repository artifact
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: full-repository
86+
path: .
3987

4088
- name: Setup Python
4189
uses: actions/setup-python@v5
4290
with:
43-
python-version: '3.11'
91+
python-version: '3.13'
4492

4593
- name: Install dependencies
4694
run: |
@@ -55,16 +103,18 @@ jobs:
55103
56104
build:
57105
name: Build Docker Images
58-
needs: [test-java, test-python]
106+
needs: [test-java, test-python, generate_api_code]
59107
runs-on: ubuntu-latest
60108
strategy:
61109
matrix:
62-
service: [client, server, user-svc, concept-svc, genai-svc]
110+
service: [client, gateway, user-svc, concept-svc, genai-svc]
111+
max-parallel: 1
63112
steps:
64-
- name: Checkout
65-
uses: actions/checkout@v4
113+
- name: Download full repository artifact
114+
uses: actions/download-artifact@v4
66115
with:
67-
fetch-depth: 0
116+
name: full-repository
117+
path: .
68118

69119
- name: Log in to the Container registry
70120
uses: docker/login-action@v3
@@ -81,7 +131,7 @@ jobs:
81131
- name: Install Docker Buildx
82132
id: buildx
83133
uses: docker/setup-buildx-action@v3
84-
134+
85135
- name: Extract metadata (tags, labels) for Docker
86136
id: meta
87137
uses: docker/metadata-action@v5

.github/workflows/deploy_kubernetes.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to Kubernetes
1+
name: Deploy to Production Kubernetes
22

33
on:
44
workflow_run:
@@ -10,11 +10,11 @@ jobs:
1010
deployment:
1111
runs-on: "ubuntu-latest"
1212
environment:
13-
name: Kubernetes
13+
name: production
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: Setup Helm
2020
uses: azure/setup-helm@v3
@@ -32,5 +32,6 @@ jobs:
3232
- name: Run Helm
3333
run: |
3434
cd helm/ai-event-concepter
35-
helm upgrade --debug --install -n team-git-push-force ai-event-concepter .
35+
helm upgrade --debug --install -n team-git-push-force ai-event-concepter . \
36+
--set ingress.host=${{ inputs.ingress_host || 'aieventconcepter.student.k8s.aet.cit.tum.de' }}
3637
kubectl rollout restart deployment -n team-git-push-force
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Deploy to Staging Kubernetes
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
pull_request:
8+
branches:
9+
- dev
10+
11+
jobs:
12+
generate_api_code:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Java
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '21'
22+
distribution: 'temurin'
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '22'
28+
cache: 'npm'
29+
30+
- name: Setup Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.13'
34+
cache: 'pip'
35+
36+
- name: Install OpenAPI Generator
37+
run: |
38+
npm install -g @openapitools/openapi-generator-cli
39+
pip install openapi-python-client
40+
41+
- name: Generate Code
42+
run: |
43+
chmod +x api/scripts/gen-all.sh
44+
./api/scripts/gen-all.sh
45+
46+
- name: Upload entire repository as artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: full-repository
50+
path: .
51+
52+
build_images:
53+
runs-on: ubuntu-latest
54+
needs: generate_api_code
55+
strategy:
56+
matrix:
57+
service: [client, gateway, user-svc, concept-svc, genai-svc]
58+
max-parallel: 1
59+
steps:
60+
- name: Download full repository artifact
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: full-repository
64+
path: .
65+
66+
- name: Log in to the Container registry
67+
uses: docker/login-action@v3
68+
with:
69+
registry: ghcr.io
70+
username: ${{ github.actor }}
71+
password: ${{ secrets.GITHUB_TOKEN }}
72+
73+
- name: Set up QEMU
74+
uses: docker/setup-qemu-action@v3
75+
with:
76+
platforms: all
77+
78+
- name: Install Docker Buildx
79+
uses: docker/setup-buildx-action@v3
80+
81+
- name: Extract metadata (tags, labels) for Docker
82+
id: meta
83+
uses: docker/metadata-action@v5
84+
with:
85+
images: ghcr.io/${{ github.repository }}/${{ matrix.service }}
86+
tags: |
87+
type=raw,value=pr-${{ github.event.pull_request.number }},enable=${{ github.event_name == 'pull_request' }}
88+
type=raw,value=latest,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/dev' }}
89+
90+
- name: Build and push Docker Image
91+
uses: docker/build-push-action@v5
92+
with:
93+
platforms: linux/amd64,linux/arm64
94+
context: ./${{ matrix.service }}
95+
file: ./${{ matrix.service }}/Dockerfile
96+
push: true
97+
tags: ${{ steps.meta.outputs.tags }}
98+
labels: ${{ steps.meta.outputs.labels }}
99+
cache-from: type=gha,scope=${{ matrix.service }}
100+
cache-to: type=gha,scope=${{ matrix.service }},mode=max
101+
102+
deploy:
103+
runs-on: ubuntu-latest
104+
needs: build_images
105+
environment:
106+
name: staging
107+
108+
steps:
109+
- name: Download full repository artifact
110+
uses: actions/download-artifact@v4
111+
with:
112+
name: full-repository
113+
path: .
114+
115+
- name: Setup Helm
116+
uses: azure/setup-helm@v3
117+
with:
118+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
120+
- name: Setup kubectl
121+
uses: azure/setup-kubectl@v3
122+
with:
123+
version: "latest"
124+
125+
- name: Configure kubeconfig
126+
run: |
127+
mkdir -p $HOME/.kube
128+
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config
129+
130+
- name: Run Helm Upgrade
131+
run: |
132+
cd helm/ai-event-concepter
133+
helm upgrade --install ai-event-concepter . \
134+
--namespace team-git-push-force-dev \
135+
--create-namespace \
136+
--set ingress.host=dev-aieventconcepter.student.k8s.aet.cit.tum.de \
137+
--set client.image.tag=pr-${{ github.event.pull_request.number || github.sha }} \
138+
--set gateway.image.tag=pr-${{ github.event.pull_request.number || github.sha }} \
139+
--set usersvc.image.tag=pr-${{ github.event.pull_request.number || github.sha }} \
140+
--set conceptsvc.image.tag=pr-${{ github.event.pull_request.number || github.sha }} \
141+
--set genaisvc.image.tag=pr-${{ github.event.pull_request.number || github.sha }}
142+
143+
- name: Rollout Restart Deployments
144+
run: |
145+
kubectl rollout restart deployment -n team-git-push-force-dev

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,14 @@ sketch
380380

381381
## OpenAPI Generator ###
382382
/client/src/api/
383-
/server/src/main/java/generated/
383+
/gateway/src/main/java/de/tum/aet/devops25/api/generated/
384384
/concept-svc/src/main/java/generated/
385385
/user-svc/src/main/java/generated/
386386
/genai-svc/client/
387387

388+
# OpenAPI Generator CLI configuration
389+
openapitools.json
390+
388391
### Infrastructure ###
389392
# Terraform
390393
.terraform/

api/scripts/gen-all.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ generate_java() {
2929
check_command openapi-generator-cli
3030

3131
# Create output directories
32-
create_dir "server/src/main/java/generated"
3332
create_dir "user-svc/src/main/java/generated"
3433
create_dir "concept-svc/src/main/java/generated"
3534

3635
# Generate code for API Gateway
3736
openapi-generator-cli generate \
3837
-i api/gateway.yaml \
3938
-g spring \
40-
-o server/src/main/java/generated \
39+
-o gateway \
4140
--skip-validate-spec \
4241
--api-package de.tum.aet.devops25.api.generated.controller \
4342
--model-package de.tum.aet.devops25.api.generated.model \

0 commit comments

Comments
 (0)