woodpecker: refactor pipeline to use kaniko.
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
build:
|
- name: build
|
||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
commands:
|
commands:
|
||||||
- go mod edit -dropreplace gitea.maximumdirect.net/ejr/feedkit
|
- go mod edit -dropreplace gitea.maximumdirect.net/ejr/feedkit
|
||||||
|
- go test ./...
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o dist/weatherfeeder ./cmd/weatherfeeder
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o dist/weatherfeeder ./cmd/weatherfeeder
|
||||||
- |
|
- |
|
||||||
@@ -14,22 +19,21 @@ steps:
|
|||||||
USER app
|
USER app
|
||||||
ENTRYPOINT ["/usr/local/bin/weatherfeeder"]
|
ENTRYPOINT ["/usr/local/bin/weatherfeeder"]
|
||||||
EOF
|
EOF
|
||||||
when:
|
|
||||||
branch: main
|
|
||||||
event: push
|
|
||||||
|
|
||||||
publish:
|
- name: publish
|
||||||
image: plugins/docker
|
image: woodpeckerci/plugin-kaniko
|
||||||
settings:
|
settings:
|
||||||
registry: harbor.maximumdirect.net
|
registry: https://harbor.maximumdirect.net
|
||||||
repo: harbor.maximumdirect.net/build/weatherfeeder
|
repo: build/weatherfeeder
|
||||||
|
dockerfile: Dockerfile.ci
|
||||||
|
context: .
|
||||||
tags:
|
tags:
|
||||||
- ${CI_COMMIT_SHA}
|
- ${CI_COMMIT_SHA}
|
||||||
- latest
|
- latest
|
||||||
dockerfile: Dockerfile.ci
|
cache: true
|
||||||
context: .
|
cache-repo: build/weatherfeeder-cache
|
||||||
depends_on:
|
username:
|
||||||
- build
|
from_secret: HARBOR_ROBOT_USER
|
||||||
when:
|
password:
|
||||||
branch: main
|
from_secret: HARBOR_ROBOT_TOKEN
|
||||||
event: push
|
|
||||||
|
|||||||
Reference in New Issue
Block a user