Two things in the deploy did not do what they looked like: build-server passed --build-arg APP_VERSION, but the Dockerfile declares ARG VERSION. An unknown build arg is ignored with a warning, so every deployed image was stamped "dev": `keeporgd -version` and the image's version label both said so, whatever the tag claimed. The build pipeline's path filter listed 'VERSION', a file this repository does not have, and '*.go', which under doublestar matches only top-level Go files, of which there are none. So a push that changed only Go code or only the version did not trigger a build. Now versions.mk and '**/*.go'. Proved: built with --build-arg VERSION=0.5.0 and ran -version in the container, which now reports 0.5.0.
27 lines
540 B
YAML
27 lines
540 B
YAML
---
|
|
when:
|
|
- path:
|
|
include:
|
|
- 'config/variables/server.values.yaml'
|
|
- '.woodpecker/build.yaml'
|
|
- 'Makefile'
|
|
- 'versions.mk'
|
|
- 'Dockerfile'
|
|
- '**/*.go'
|
|
event: push
|
|
labels:
|
|
role: production
|
|
skip_clone: true
|
|
steps:
|
|
clone:
|
|
image: bash
|
|
commands:
|
|
- git clone --depth=1 ${CI_REPO_CLONE_SSH_URL}
|
|
build:
|
|
image: bash
|
|
commands:
|
|
- cd ${CI_REPO_NAME} && echo $GIT_SUDO | sudo -S make build-server
|
|
environment:
|
|
GIT_SUDO:
|
|
from_secret: git_sudo
|