Added base woodpecker task

This commit is contained in:
2025-11-03 15:02:49 +01:00
parent 7fdb902a11
commit faed55b9c7
2 changed files with 103 additions and 67 deletions

View File

@@ -1,67 +0,0 @@
kind: pipeline
type: docker
name: default
steps:
- name: static_check
image: golang:latest
commands:
- go install honnef.co/go/tools/cmd/staticcheck@latest
- cd src && staticcheck ./...
volumes:
- name: gopath
path: /go
- name: lint
image: golang:latest
commands:
- go install golang.org/x/lint/golint@latest
- golint ./src/...
volumes:
- name: gopath
path: /go
- name: analyze
image: golang:latest
commands:
- cd src && go vet ./...
volumes:
- name: gopath
path: /go
- name: publish_image
image: plugins/docker
environment:
DOCKER_USERNAME:
from_secret: registry_username
DOCKER_PASSWORD:
from_secret: registry_password
commands:
- sleep 5
- ./deploy/image-build.sh
- ./deploy/image-push.sh
volumes:
- name: docker-sock
path: /var/run
when:
branch:
- main
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: docker-sock
path: /var/run
- name: etc_hosts
path: /etc/hosts
volumes:
- name: gopath
temp: {}
- name: docker-sock
temp: {}
- name: etc_hosts
host:
path: /etc/hosts

103
.woodpecker/workflow.yaml Normal file
View File

@@ -0,0 +1,103 @@
when:
- event: push
branch: develop
steps:
# - name: analyze
# image: golang:1.24
# commands:
# - echo "Analyze"
# - cd src && go vet ./...
# - name: static check
# image: golang:1.24
# commands:
# - echo "Static Check"
# - go install honnef.co/go/tools/cmd/staticcheck@latest
# - cd src && staticcheck ./...
# - name: lint
# image: golang:1.24
# commands:
# - echo "Lint"
# - go install golang.org/x/lint/golint@latest
# - golint ./src/...
- name: publish image
image: woodpeckerci/plugin-docker-buildx
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: git.ego.freeddns.org/egommerce/catalog-svc:dev
registry: git.ego.freeddns.org
# commands:
# - sleep 5
# - ./deploy/image-build.sh
# - ./deploy/image-push.sh
# kind: pipeline
# type: docker
# name: default
# steps:
# - name: static_check
# image: golang:latest
# commands:
# - go install honnef.co/go/tools/cmd/staticcheck@latest
# - cd src && staticcheck ./...
# volumes:
# - name: gopath
# path: /go
# - name: lint
# image: golang:latest
# commands:
# - go install golang.org/x/lint/golint@latest
# - golint ./src/...
# volumes:
# - name: gopath
# path: /go
# - name: analyze
# image: golang:latest
# commands:
# - cd src && go vet ./...
# volumes:
# - name: gopath
# path: /go
# - name: publish_image
# image: plugins/docker
# environment:
# DOCKER_USERNAME:
# from_secret: registry_username
# DOCKER_PASSWORD:
# from_secret: registry_password
# commands:
# - sleep 5
# - ./deploy/image-build.sh
# - ./deploy/image-push.sh
# volumes:
# - name: docker-sock
# path: /var/run
# when:
# branch:
# - main
# services:
# - name: docker
# image: docker:dind
# privileged: true
# volumes:
# - name: docker-sock
# path: /var/run
# - name: etc_hosts
# path: /etc/hosts
# volumes:
# - name: gopath
# temp: {}
# - name: docker-sock
# temp: {}
# - name: etc_hosts
# host:
# path: /etc/hosts