Skip to content

Commit

Permalink
switch to k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
emilburzo committed Feb 21, 2024
1 parent b63590d commit d7b25ed
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .ci/constants.sh

This file was deleted.

9 changes: 3 additions & 6 deletions .ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

. .ci/constants.sh

docker pull ${IMAGE}
docker stop ${NAME}
docker rm ${NAME}
docker run -d --restart=always --name ${NAME} -p ${PORT}:8080 ${IMAGE}
SHORT_SHA="$(git rev-parse --short HEAD)"
echo "SHORT_SHA=${SHORT_SHA}"
cat .ci/deploy.yaml | sed "s/SHORT_SHA/${SHORT_SHA}/g" | kubectl apply -f -
51 changes: 51 additions & 0 deletions .ci/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nest-rest
labels:
app: nest-rest
spec:
replicas: 1
selector:
matchLabels:
app: nest-rest
template:
metadata:
labels:
app: nest-rest
spec:
containers:
- name: nest-rest
image: emilburzo/nest-rest:SHORT_SHA
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: nest-rest
labels:
run: nest-rest
spec:
ports:
- port: 8080
protocol: TCP
selector:
app: nest-rest
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nest-rest
spec:
rules:
- host: nest-rest.emilburzo.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nest-rest
port:
number: 8080

0 comments on commit d7b25ed

Please sign in to comment.