gorush/.drone.yml

271 lines
5.0 KiB
YAML
Raw Normal View History

---
kind: pipeline
name: testing
platform:
arch: amd64
os: linux
services:
- image: redis
name: redis
- commands:
- /nsqd
image: nsqio/nsq
name: nsq
steps:
- commands:
- make embedmd
image: golang:1.18
name: embedmd
pull: always
volumes:
- name: gopath
path: /go
- commands:
2020-03-01 12:31:28 +00:00
- hadolint --version
- hadolint docker/Dockerfile.linux.amd64
- hadolint docker/Dockerfile.linux.arm64
- hadolint docker/Dockerfile.linux.arm
image: hadolint/hadolint:latest-debian
name: hadolint
pull: always
volumes:
- name: gopath
path: /go
volumes:
- name: gopath
temp: {}
---
depends_on:
- testing
kind: pipeline
name: linux-amd64
platform:
arch: amd64
os: linux
steps:
- commands:
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/gorush
environment:
CGO_ENABLED: "0"
image: golang:1.18
name: build-push
pull: always
when:
event:
exclude:
- tag
- commands:
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}'
-a -o release/linux/amd64/gorush
environment:
CGO_ENABLED: "0"
image: golang:1.18
name: build-tag
pull: always
when:
event:
- tag
- commands:
- ./release/linux/amd64/gorush --help
image: golang:1.18
name: executable
pull: always
- image: plugins/docker:linux-amd64
name: publish
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
cache_from: appleboy/gorush
daemon_off: "false"
dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: appleboy/gorush
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/pull/**
- refs/tags/**
---
depends_on:
- testing
kind: pipeline
name: linux-arm64
platform:
arch: arm64
os: linux
steps:
- commands:
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/gorush
environment:
CGO_ENABLED: "0"
image: golang:1.18
name: build-push
pull: always
when:
event:
exclude:
- tag
- commands:
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}'
-a -o release/linux/arm64/gorush
environment:
CGO_ENABLED: "0"
image: golang:1.18
name: build-tag
pull: always
when:
event:
- tag
- commands:
- ./release/linux/arm64/gorush --help
image: golang:1.18
name: executable
pull: always
- image: plugins/docker:linux-arm64
name: publish
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
cache_from: appleboy/gorush
daemon_off: "false"
dockerfile: docker/Dockerfile.linux.arm64
password:
from_secret: docker_password
repo: appleboy/gorush
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/pull/**
- refs/tags/**
---
depends_on:
- testing
kind: pipeline
name: linux-arm
platform:
arch: arm
os: linux
steps:
- commands:
- go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/gorush
environment:
CGO_ENABLED: "0"
image: golang:1.18
name: build-push
pull: always
when:
event:
exclude:
- tag
- commands:
- go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}'
-a -o release/linux/arm/gorush
environment:
CGO_ENABLED: "0"
image: golang:1.18
name: build-tag
pull: always
when:
event:
- tag
- commands:
- ./release/linux/arm/gorush --help
image: golang:1.18
name: executable
pull: always
- image: plugins/docker:linux-arm
name: publish
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-arm
cache_from: appleboy/gorush
daemon_off: "false"
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: appleboy/gorush
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/pull/**
- refs/tags/**
---
depends_on:
- testing
kind: pipeline
name: release-binary
platform:
arch: amd64
os: linux
steps:
- commands:
- make release
image: golang:1.18
name: build-all-binary
pull: always
when:
event:
- tag
- image: plugins/github-release
name: deploy-all-binary
pull: always
settings:
api_key:
from_secret: github_release_api_key
files:
- dist/release/*
when:
event:
- tag
trigger:
ref:
- refs/tags/**
---
depends_on:
- linux-amd64
- linux-arm64
- linux-arm
- release-binary
kind: pipeline
name: notifications
platform:
arch: amd64
os: linux
steps:
- image: plugins/manifest
name: manifest
pull: always
settings:
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username
trigger:
ref:
- refs/heads/master
- refs/tags/**