Compare commits
2 Commits
5021794990
...
b68e929c57
Author | SHA1 | Date | |
---|---|---|---|
b68e929c57 | |||
89089f429c |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
build
|
build
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
snmp-mqtt
|
||||||
|
29
.woodpecker.yml
Normal file
29
.woodpecker.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: plugins/kaniko
|
||||||
|
settings:
|
||||||
|
repo: gitea.hottis.de/wn/snmp-mqtt
|
||||||
|
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: portainer/kubectl-shell:latest
|
||||||
|
secrets:
|
||||||
|
- source: kube_config
|
||||||
|
target: KUBE_CONFIG_CONTENT
|
||||||
|
- source: image_name
|
||||||
|
target: IMAGE_NAME
|
||||||
|
commands:
|
||||||
|
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
||||||
|
- export KUBECONFIG=/tmp/kubeconfig
|
||||||
|
- cat $CI_WORKSPACE/deployment/deploy-yml.tmpl | sed -e 's,%IMAGE%,'$IMAGE_NAME':'$CI_COMMIT_TAG',' | kubectl apply -f -
|
||||||
|
when:
|
||||||
|
- event: tag
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM golang:1.21-alpine as builder
|
||||||
|
|
||||||
|
RUN mkdir -p /go/src /go/src/snmp /go/src/config
|
||||||
|
COPY ./snmp-mqtt.go /go/src
|
||||||
|
COPY ./snmp/ /go/src/snmp
|
||||||
|
COPY ./config/ /go/src/config
|
||||||
|
COPY ./go.mod /go/src
|
||||||
|
COPY ./go.sum /go/src
|
||||||
|
WORKDIR /go/src
|
||||||
|
RUN go mod tidy && go build -a -installsuffix nocgo -o snmp-mqtt github.com/dchote/snmp-mqtt
|
||||||
|
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
|
ENV SNMP_MQTT_CONF ""
|
||||||
|
|
||||||
|
COPY --from=builder /go/src/snmp-mqtt ./
|
||||||
|
ENTRYPOINT ["./snmp-mqtt"]
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user