Better tagging and templating

This commit is contained in:
2023-11-05 01:17:56 +01:00
parent 8cb98f0848
commit 8ff0aa3e94
3 changed files with 12 additions and 3 deletions

View File

@@ -33,7 +33,9 @@ steps:
from_secret: GITHUB_USERNAME
password:
from_secret: GITHUB_PASSWORD
tags: latest
tags:
- latest
- ${DRONE_COMMIT_SHA}
when:
event:
include:
@@ -42,6 +44,7 @@ steps:
- pull_request
branch:
- main
- kube
---
kind: pipeline
@@ -58,7 +61,10 @@ steps:
commands:
- mkdir -p /root/.kube
- echo $KUBE_CONFIG | base64 -di > /root/.kube/config
- kubectl --kubeconfig=/root/.kube/config apply -f .kubernetes
- export IMAGE=ghcr.io/kevinmidboe/k9e.no:${DRONE_COMMIT_SHA}
- cat .kubernetes/*.yml
| envsubst -
| kubectl --kubeconfig=/root/.kube/config apply -f -
environment:
KUBE_CONFIG:
from_secret: KUBE_CONFIG
@@ -70,6 +76,7 @@ steps:
- pull_request
branch:
- main
- kube
depends_on:
- Build

View File

@@ -1,3 +1,4 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -26,7 +27,7 @@ spec:
app: k9e
spec:
containers:
- image: ghcr.io/kevinmidboe/k9e.no:latest
- image: ${IMAGE}
imagePullPolicy: IfNotPresent
name: k9e
resources: {}

View File

@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: Service
metadata: