Skip to content

Commit f3d1197

Browse files
FlurinFlurin
Flurin
authored and
Flurin
committed
2 parents 30682ab + e905084 commit f3d1197

File tree

13 files changed

+117
-8
lines changed

13 files changed

+117
-8
lines changed

.github/workflows/azure-kubernetes-service.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525

2626
- name: Get Short Commit SHA
2727
run: |
28-
echo "COMMIT_SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-7)"
2928
echo "COMMIT_SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
3029
3130
- name: Build docker images
3231
run: |
3332
echo "Building images"
3433
docker build -t z100/soemi-woeb:${{ env.COMMIT_SHA_SHORT }} ./soemi-woeb
3534
docker build -t z100/soemi-woers:${{ env.COMMIT_SHA_SHORT }} ./soemi-woers
35+
docker build -t z100/soemi-proexy:${{ env.COMMIT_SHA_SHORT }} ./soemi-proexy
3636
3737
- name: Push docker images
3838
run: |
@@ -42,6 +42,7 @@ jobs:
4242
echo "Pushing images"
4343
docker push z100/soemi-woeb:${{ env.COMMIT_SHA_SHORT }}
4444
docker push z100/soemi-woers:${{ env.COMMIT_SHA_SHORT }}
45+
docker push z100/soemi-proexy:${{ env.COMMIT_SHA_SHORT }}
4546
4647
deploy-services:
4748
permissions:
@@ -57,13 +58,13 @@ jobs:
5758

5859
- name: Get Short Commit SHA
5960
run: |
60-
echo "COMMIT_SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-7)"
6161
echo "COMMIT_SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
6262
6363
- name: Populate deployment.yaml with vars
6464
run: |
6565
sed -i "s|\$IMAGE_TAG|${{ env.COMMIT_SHA_SHORT }}|g" ./soemi-woeb/k8s/deployment.yaml
6666
sed -i "s|\$IMAGE_TAG|${{ env.COMMIT_SHA_SHORT }}|g" ./soemi-woers/k8s/deployment.yaml
67+
sed -i "s|\$IMAGE_TAG|${{ env.COMMIT_SHA_SHORT }}|g" ./soemi-proexy/k8s/deployment.yaml
6768
6869
- name: Azure login
6970
uses: azure/login@v1.4.6
@@ -86,5 +87,23 @@ jobs:
8687
- name: Deploy microservices to AKS
8788
run: |
8889
echo "Deploying services"
90+
kubectl replace --force -f ./soemi-moen/k8s
91+
kubectl replace --force -f ./soemi-proexy/k8s
8992
kubectl replace --force -f ./soemi-woeb/k8s
9093
kubectl replace --force -f ./soemi-woers/k8s
94+
95+
- name: Deploy process into camunda
96+
run: |
97+
echo "Sleeping for 10 to wait for pod"
98+
sleep 10
99+
100+
echo "Forwarding port"
101+
camundaPod=$(kubectl get pods | grep 'soemi-moen' | awk '{print $1}')
102+
kubectl port-forward $camundaPod 8080:8080 &
103+
sleep 5
104+
105+
echo "Deploying camunda bpmn into pod"
106+
curl -w "\n" -H "Content-Type: multipart/form-data" -F "deployment-name=soemi-moen-bpmn" -F "enable-duplicate-filtering=true" -F "deploy-changed-only=true" -F "deployment-source=process application" -F "data=@./soemi-moen/soemi-moen.bpmn" http://localhost:8080/engine-rest/deployment/create
107+
108+
echo "Killing port-forwarding"
109+
pkill -f "kubectl port-forward"

k8s/common/kubeconfig.yaml

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

k8s/common/secrets.yaml

Whitespace-only changes.

k8s/ingress/ingress-controller-deployment.yaml

Whitespace-only changes.

k8s/ingress/ingress-controller-service.yaml

Whitespace-only changes.

k8s/namespace.yaml

Whitespace-only changes.

soemi-moen/k8s/deployment.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: soemi-moen
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: soemi-moen
10+
template:
11+
metadata:
12+
labels:
13+
app: soemi-moen
14+
spec:
15+
containers:
16+
- name: soemi-moen
17+
image: camunda/camunda-bpm-platform:run-latest
18+
ports:
19+
- containerPort: 8080

soemi-moen/k8s/ingress.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: soemi-moen-ingress
5+
annotations:
6+
kubernetes.io/ingress.class: "nginx"
7+
nginx.ingress.kubernetes.io/rewrite-target: /camunda/$2
8+
spec:
9+
rules:
10+
- host: xn--smi-weather-rfb.ch
11+
http:
12+
paths:
13+
- path: /moen(|$)(.*)
14+
pathType: Prefix
15+
backend:
16+
service:
17+
name: soemi-moen
18+
port:
19+
number: 8080

soemi-moen/k8s/service.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: soemi-moen
5+
labels:
6+
app: soemi-moen
7+
spec:
8+
type: ClusterIP
9+
selector:
10+
app: soemi-moen
11+
ports:
12+
- protocol: TCP
13+
port: 8080
14+
targetPort: 8080
15+
name: http

soemi-proexy/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM nginx
2+
COPY nginx.conf ./nginx.conf

soemi-proexy/k8s/deployment.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: soemi-proexy
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: soemi-proexy
10+
template:
11+
metadata:
12+
labels:
13+
app: soemi-proexy
14+
spec:
15+
containers:
16+
- name: soemi-proexy
17+
image: z100/soemi-proexy:$IMAGE_TAG
18+
ports:
19+
- containerPort: 8080

soemi-proexy/k8s/service.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: soemi-proexy
5+
spec:
6+
selector:
7+
app: soemi-proexy
8+
type: ClusterIP
9+
ports:
10+
- port: 8080
11+
targetPort: 8080

soemi-proexy/nginx.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
events {}
2+
3+
http {
4+
server {
5+
listen 8080;
6+
7+
location /api {
8+
proxy_pass http://soemi-woers:8089/;
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)