parent
ba3d45c97a
commit
6cf8c4cf15
2 changed files with 59 additions and 0 deletions
16
.woodpecker/1-check.yml
Normal file
16
.woodpecker/1-check.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
steps:
|
||||||
|
- name: check-format
|
||||||
|
image: golang
|
||||||
|
environment:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
commands:
|
||||||
|
- go fmt $(go list ./... | grep -v /vendor/)
|
||||||
|
- go vet $(go list ./... | grep -v /vendor/)
|
||||||
|
- go test -race $(go list ./... | grep -v /vendor/)
|
||||||
|
|
||||||
|
- name: check-sec
|
||||||
|
image: golang
|
||||||
|
commands:
|
||||||
|
- go install github.com/securego/gosec/v2/cmd/gosec@latest
|
||||||
|
- go get -v -d .
|
||||||
|
- gosec ./...
|
43
.woodpecker/2-build-latest.yml
Normal file
43
.woodpecker/2-build-latest.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
steps:
|
||||||
|
- name: build-binary-UT-lin/amd64
|
||||||
|
image: golang:latest
|
||||||
|
commands:
|
||||||
|
- go get -v -d ./...
|
||||||
|
- go build -a -installsuffix cgo -o linux-amd64 .
|
||||||
|
|
||||||
|
- name: build-docker-latest-lin/amd64
|
||||||
|
image: woodpeckerci/plugin-docker-buildx:3
|
||||||
|
environment:
|
||||||
|
- DOCKER_HOST=tcp://docker:2376
|
||||||
|
settings:
|
||||||
|
platforms: linux/amd64
|
||||||
|
repo: git.hackmi.ch/Phil/goshorly
|
||||||
|
registry: git.hackmi.ch
|
||||||
|
tags: latest
|
||||||
|
username:
|
||||||
|
from_secret: reg-user
|
||||||
|
password:
|
||||||
|
from_secret: reg-pass
|
||||||
|
build_args:
|
||||||
|
- CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
|
||||||
|
- CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHA:0:8}
|
||||||
|
depends_on:
|
||||||
|
- build-binary-UT-lin/amd64
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
- event: [tag, deployment, release, cron]
|
||||||
|
|
||||||
|
services:
|
||||||
|
docker:
|
||||||
|
image: docker:24-dind
|
||||||
|
commands:
|
||||||
|
- dockerd --tls=false --host=tcp://0.0.0.0:2376
|
||||||
|
privileged: true
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
- event: [tag, deployment, release, cron]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- 1-check
|
Loading…
Reference in a new issue