minimal-setups/.woodpecker.yml

69 lines
2.0 KiB
YAML
Raw Normal View History

2025-01-13 10:42:19 +01:00
steps:
build:
image: plugins/kaniko
settings:
repo: ${FORGE_NAME}/${CI_REPO}
registry:
from_secret: container_registry
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
username:
from_secret: container_registry_username
password:
from_secret: container_registry_password
2025-01-13 14:44:58 +01:00
build-args: "BASE_URL=https://minimal-setups.de, RELEASETAG=${CI_COMMIT_SHA}"
2025-01-13 12:50:24 +01:00
2025-01-13 10:42:19 +01:00
dockerfile: Dockerfile
when:
2025-01-13 11:09:47 +01:00
- event: [push,tag]
2025-01-13 10:42:19 +01:00
2025-02-11 13:00:41 +01:00
scan:
image: quay.io/wollud1969/woodpecker-helper:0.5.1
environment:
TRIVY_TOKEN:
from_secret: trivy_token
TRIVY_URL:
from_secret: trivy_url
DTRACK_API_KEY:
from_secret: dtrack_api_key
DTRACK_API_URL:
from_secret: dtrack_api_url
2025-01-16 11:49:11 +01:00
commands:
2025-02-11 13:00:41 +01:00
- export GOPATH=/woodpecker/go # the export is required, otherwise trivy will not consider the variable
- HOME=/home/`id -nu`
- TAG="${CI_COMMIT_TAG:-$CI_COMMIT_SHA}"
- |
trivy image \
--server $TRIVY_URL \
--token $TRIVY_TOKEN \
--format cyclonedx \
--scanners license \
--output /tmp/sbom.xml \
$FORGE_NAME/$CI_REPO:$CI_COMMIT_SHA
- cat /tmp/sbom.xml
- |
curl -X "POST" \
-H "Content-Type: multipart/form-data" \
-H "X-Api-Key: $DTRACK_API_KEY" \
-F "autoCreate=true" \
-F "projectName=$CI_REPO" \
-F "projectVersion=$TAG" \
-F "bom=@/tmp/sbom.xml"\
"$DTRACK_API_URL/api/v1/bom"
2025-01-16 11:49:11 +01:00
when:
- event: [push, tag]
2025-02-11 13:00:41 +01:00
2025-01-13 10:42:19 +01:00
deploy:
image: portainer/kubectl-shell:latest
2025-03-13 13:13:11 +01:00
environment:
KUBE_CONFIG_CONTENT:
from_secret: kube_config
2025-01-13 10:42:19 +01:00
commands:
2025-01-13 12:52:41 +01:00
- export IMAGE_TAG=$CI_COMMIT_SHA
2025-01-13 10:42:19 +01:00
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
- export KUBECONFIG=/tmp/kubeconfig
- ./deployment/deploy.sh
when:
2025-01-13 12:51:26 +01:00
- event: [push,tag]
2025-01-13 10:42:19 +01:00