mirror of
https://github.com/KevinMidboe/k9e.no.git
synced 2025-10-29 17:50:14 +00:00
44
.drone.yml
44
.drone.yml
@@ -1,26 +1,29 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: Build and publish
|
name: Build
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: lint
|
- name: Install dependencies
|
||||||
image: node:21-alpine3.17
|
image: node:21-alpine3.17
|
||||||
commands:
|
commands:
|
||||||
- yarn
|
- yarn
|
||||||
|
|
||||||
|
- name: Lint project
|
||||||
|
image: node:21-alpine3.17
|
||||||
|
commands:
|
||||||
- yarn lint
|
- yarn lint
|
||||||
|
|
||||||
- name: build
|
- name: Build
|
||||||
image: node:21-alpine3.17
|
image: node:21-alpine3.17
|
||||||
commands:
|
commands:
|
||||||
- yarn
|
|
||||||
- yarn build
|
- yarn build
|
||||||
|
|
||||||
- name: Build and publish docker image
|
- name: Publish to ghcr
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -39,3 +42,34 @@ steps:
|
|||||||
- pull_request
|
- pull_request
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: Deploy
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy to kubernetes
|
||||||
|
image: alpine/k8s:1.25.15
|
||||||
|
commands:
|
||||||
|
- mkdir -p /root/.kube
|
||||||
|
- echo $KUBE_CONFIG | base64 -di > /root/.kube/config
|
||||||
|
- kubectl --kubeconfig=/root/.kube/config apply -f .kubernetes
|
||||||
|
environment:
|
||||||
|
KUBE_CONFIG:
|
||||||
|
from_secret: KUBE_CONFIG
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
include:
|
||||||
|
- push
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- Build
|
||||||
|
|||||||
5
.kubernetes/0-namespace.yml
Normal file
5
.kubernetes/0-namespace.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: k9e
|
||||||
39
.kubernetes/deployment.yml
Normal file
39
.kubernetes/deployment.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
deployment.kubernetes.io/revision: '1'
|
||||||
|
labels:
|
||||||
|
app: k9e
|
||||||
|
name: k9e
|
||||||
|
namespace: k9e
|
||||||
|
spec:
|
||||||
|
progressDeadlineSeconds: 600
|
||||||
|
replicas: 2
|
||||||
|
revisionHistoryLimit: 10
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: k9e
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 25%
|
||||||
|
maxUnavailable: 25%
|
||||||
|
type: RollingUpdate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: k9e
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: ghcr.io/kevinmidboe/k9e.no:latest
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
name: k9e
|
||||||
|
resources: {}
|
||||||
|
terminationMessagePath: /dev/termination-log
|
||||||
|
terminationMessagePolicy: File
|
||||||
|
dnsPolicy: ClusterFirst
|
||||||
|
restartPolicy: Always
|
||||||
|
schedulerName: default-scheduler
|
||||||
|
securityContext: {}
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
18
.kubernetes/service.yml
Normal file
18
.kubernetes/service.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: k9e
|
||||||
|
name: k9e-service
|
||||||
|
namespace: k9e
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 80
|
||||||
|
selector:
|
||||||
|
app: k9e
|
||||||
|
sessionAffinity: None
|
||||||
|
type: ClusterIP
|
||||||
|
status:
|
||||||
|
loadBalancer: {}
|
||||||
Reference in New Issue
Block a user