mirror of
https://github.com/KevinMidboe/infra-map.git
synced 2025-12-08 20:29:05 +00:00
better checks for when to build+deploy varnish image
This commit is contained in:
26
.drone.yml
26
.drone.yml
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: Build
|
name: Build app
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
@@ -26,7 +26,7 @@ steps:
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: Publish
|
name: Publish app to gchr
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
@@ -64,14 +64,11 @@ depends_on:
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: Publish
|
name: Publish varnish image
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
arch: amd64
|
arch: amd64
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: config-check
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: check-config
|
- name: check-config
|
||||||
@@ -79,11 +76,11 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- git fetch --no-tags --depth=2
|
- git fetch --no-tags --depth=2
|
||||||
- |
|
- |
|
||||||
if git diff --quiet HEAD^ HEAD -- varnish/default.vcl; then
|
if git diff-tree --no-commit-id --name-only -r HEAD | grep -qE '(\.drone.yml|(varnish/.+(vcl|tmpl)(\n|$)))'; then
|
||||||
|
echo "Changes detected in varnish config"
|
||||||
|
else
|
||||||
echo "No changes in varnish config file, skipping..."
|
echo "No changes in varnish config file, skipping..."
|
||||||
exit 78 # exit code 78 = skip in Drone
|
exit 78 # exit code 78 = skip in Drone
|
||||||
else
|
|
||||||
echo "Changes detected in varnish config"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Publish varnish to ghcr
|
- name: Publish varnish to ghcr
|
||||||
@@ -99,7 +96,8 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: GHCR_UPLOAD_TOKEN
|
from_secret: GHCR_UPLOAD_TOKEN
|
||||||
build_args_from_env:
|
build_args_from_env:
|
||||||
-
|
- IMAGE_HOST
|
||||||
|
- IMAGE_PROXY
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- ${DRONE_COMMIT_SHA}
|
- ${DRONE_COMMIT_SHA}
|
||||||
@@ -113,13 +111,11 @@ trigger:
|
|||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
- update
|
- update
|
||||||
depends_on:
|
|
||||||
- Build
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: Deploy
|
name: Deploy to kubernetes
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
@@ -186,6 +182,4 @@ volumes:
|
|||||||
temp: {}
|
temp: {}
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 01caa41521eac62356f6fc941cdd489dae8e2c4249bdb4e4dc1a32e101c639b7
|
hmac: 3ba933b1c9b7f6bda1691bfb0335290f461d08cebfc5e9fe60c2f272604189d0
|
||||||
|
|
||||||
...
|
|
||||||
|
|||||||
Reference in New Issue
Block a user