drone-docker/.drone.yml
surtur 6b86978633
ci: use plugins/docker:linux-amd64
* bump from :18
* add repo tag for dry_run
2021-10-22 14:24:57 +02:00

122 lines
2.1 KiB
YAML

---
kind: pipeline
name: testing
platform:
os: linux
arch: amd64
steps:
- name: vet
image: golang:1.13
commands:
- go vet ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: /go
- name: test
image: golang:1.13
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.13
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.13
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.13
commands:
- ./release/linux/amd64/drone-docker --help
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
daemon_off: false
dockerfile: docker/docker/Dockerfile.linux.amd64
dry_run: true
repo: immawanderer/drone-docker
tags: [linux-amd64, edge-dind]
when:
event: [push, pull_request]
- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
daemon_off: false
dockerfile: docker/docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: immawanderer/drone-docker
username:
from_secret: docker_username
when:
branch: [edge-dind]
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/heads/edge-dind
- refs/heads/feature-*
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- testing
...