+35
-12
@@ -1,3 +1,4 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: default
|
||||
@@ -10,39 +11,61 @@ trigger:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
workspace:
|
||||
path: /drone/src
|
||||
path: /drone/src/network-go
|
||||
|
||||
steps:
|
||||
- name: build multiarch from dev
|
||||
- name: test
|
||||
image: docker.io/library/golang:1.26-alpine
|
||||
pull: always
|
||||
commands:
|
||||
- apk add --no-cache git
|
||||
- cd /drone/src/network-go
|
||||
- go mod download
|
||||
- go test ./... -count=1 -v
|
||||
|
||||
- name: build
|
||||
image: docker.io/library/golang:1.26-alpine
|
||||
pull: always
|
||||
commands:
|
||||
- apk add --no-cache git
|
||||
- cd /drone/src/network-go
|
||||
- go build -o network-go -ldflags="-s -w" .
|
||||
|
||||
- name: build-multiarch
|
||||
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||
privileged: true
|
||||
settings:
|
||||
cache-from: [ "registry.dev.format.hu/firewall" ]
|
||||
cache-from:
|
||||
- registry.dev.format.hu/network-go
|
||||
registry: registry.dev.format.hu
|
||||
repo: registry.dev.format.hu/firewall
|
||||
repo: registry.dev.format.hu/network-go
|
||||
tags: latest
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
username:
|
||||
from_secret: dev-hu-registry-username
|
||||
password:
|
||||
password:
|
||||
from_secret: dev-hu-registry-password
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
|
||||
- name: pull image to dockerhub
|
||||
|
||||
- name: push-to-dockerhub
|
||||
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||
privileged: true
|
||||
settings:
|
||||
cache-from: [ "safebox/firewall" ]
|
||||
repo: safebox/firewall
|
||||
cache-from:
|
||||
- safebox/network-go
|
||||
repo: safebox/network-go
|
||||
tags: latest
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
username:
|
||||
from_secret: dockerhub-username
|
||||
password:
|
||||
password:
|
||||
from_secret: dockerhub-password
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
|
||||
- linux/arm64
|
||||
Reference in New Issue
Block a user