42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
steps:
|
|
build:
|
|
image: golang:1.22.5-alpine3.20
|
|
commands:
|
|
- GOPATH=/woodpecker/go
|
|
- ls -l
|
|
- cd src/smq
|
|
- go mod tidy
|
|
- go build -a -installsuffix nocgo -o smq snmp-mqtt.go
|
|
- cp smq ../..
|
|
when:
|
|
- event: [push, tag]
|
|
|
|
dockerize:
|
|
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
|
|
dockerfile: Dockerfile
|
|
when:
|
|
- event: [push, tag]
|
|
|
|
deploy:
|
|
image: quay.io/wollud1969/woodpecker-helper:0.5.1
|
|
environment:
|
|
KUBE_CONFIG_CONTENT:
|
|
from_secret: kube_config
|
|
commands:
|
|
- export IMAGE_TAG=$CI_COMMIT_TAG
|
|
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
|
- export KUBECONFIG=/tmp/kubeconfig
|
|
- ./deployment/deploy.sh
|
|
when:
|
|
- event: [tag]
|
|
|