drone-docker/.drone.yml
surtur 84c5ad3eaa
ci: edit .drone.yml to only build for linux-amd64
* rm windows pipelines as I don't have any windows runners
* rm arm/arm64 pipelines as I don't have any arm runners
* rm {ecr,acr,whatever} publish steps as we're not publishing anything
  just yet
* tag the image under immawanderer, not the official plugins repo
* run as a dry_run (cause we're not really publishing, right?)
2022-04-01 20:16:17 +02:00

105 lines
1.7 KiB
YAML

---
kind: pipeline
name: testing
platform:
os: linux
arch: amd64
steps:
- name: vet
image: golang:1.17.3
commands:
- go vet ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: /go
- name: test
image: golang:1.17.3
commands:
- go test -cover ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: /go
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/heads/edge-dind
- refs/heads/feature-*
- "refs/tags/**"
- "refs/pull/**"
---
kind: pipeline
name: linux-amd64-docker
platform:
os: linux
arch: amd64
steps:
- name: build-push
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: executable
image: golang:1.17.3
commands:
- ./release/linux/amd64/drone-docker --help
- name: publish
image: plugins/docker:18
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
daemon_off: false
dockerfile: docker/docker/Dockerfile.linux.amd64
repo: immawanderer/drone-docker
dry_run: true
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/heads/edge-dind
- refs/heads/feature-*
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- testing
...