Migrate configs to drone 1.0.0 and drop appveyor

This commit is contained in:
Thomas Boerger 2019-01-20 23:52:03 +01:00
parent 47c0f87fa7
commit a8e12785e6
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B
3 changed files with 507 additions and 132 deletions

161
.drone.jsonnet Normal file
View File

@ -0,0 +1,161 @@
local PipelineTesting = {
kind: "pipeline",
name: "testing",
platform: {
os: "linux",
arch: "amd64",
},
steps: [
{
name: "vet",
image: "golang:1.11",
pull: "always",
environment: {
GO111MODULE: "on",
},
commands: [
"go vet ./...",
],
},
{
name: "test",
image: "golang:1.11",
pull: "always",
environment: {
GO111MODULE: "on",
},
commands: [
"go test -cover ./...",
],
},
],
trigger: {
branch: [ "master" ],
},
};
local PipelineBuild(os="linux", arch="amd64") = {
kind: "pipeline",
name: os + "-" + arch,
platform: {
os: os,
arch: arch,
},
steps: [
{
name: "build",
image: "golang:1.11",
pull: "always",
environment: {
CGO_ENABLED: "0",
GO111MODULE: "on",
},
commands: [
"go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/" + os + "/" + arch + "/drone-hugo",
],
when: {
event: [ "push", "pull_request" ],
},
},
{
name: "build",
image: "golang:1.11",
pull: "always",
environment: {
CGO_ENABLED: "0",
GO111MODULE: "on",
},
commands: [
"go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/" + os + "/" + arch + "/drone-hugo",
],
when: {
event: [ "tag" ],
},
},
{
name: "dryrun",
image: "plugins/docker:" + os + "-" + arch,
pull: "always",
settings: {
dry_run: true,
tags: os + "-" + arch,
dockerfile: "docker/Dockerfile." + os + "." + arch,
repo: "plugins/hugo",
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
},
when: {
event: [ "pull_request" ],
},
},
{
name: "publish",
image: "plugins/docker:" + os + "-" + arch,
pull: "always",
settings: {
auto_tag: true,
auto_tag_suffix: os + "-" + arch,
dockerfile: "docker/Dockerfile." + os + "." + arch,
repo: "plugins/hugo",
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
},
when: {
event: [ "push", "tag" ],
},
},
],
depends_on: [
"testing",
],
trigger: {
branch: [ "master" ],
},
};
local PipelineNotifications = {
kind: "pipeline",
name: "notifications",
platform: {
os: "linux",
arch: "amd64",
},
steps: [
{
name: "manifest",
image: "plugins/manifest:1",
pull: "always",
settings: {
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
spec: "docker/manifest.tmpl",
ignore_missing: true,
},
},
{
name: "microbadger",
image: "plugins/webhook:1",
pull: "always",
settings: {
url: { "from_secret": "microbadger_url" },
},
},
],
depends_on: [
"linux-amd64",
"linux-arm64",
"linux-arm",
],
trigger: {
branch: [ "master" ],
event: [ "push", "tag" ],
},
};
[
PipelineTesting,
PipelineBuild("linux", "amd64"),
PipelineBuild("linux", "arm64"),
PipelineBuild("linux", "arm"),
PipelineNotifications,
]

70
.drone.windows.yml Normal file
View File

@ -0,0 +1,70 @@
---
kind: pipeline
name: linux-amd64
platform:
os: linux
arch: amd64
steps:
- name: build
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request
- name: build
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/hugo
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: plugins/hugo
username:
from_secret: docker_username
when:
event:
- push
- tag
trigger:
branch:
- master

View File

@ -1,147 +1,291 @@
workspace: ---
base: /go kind: pipeline
path: src/github.com/drone-plugins/drone-hugo name: testing
pipeline: platform:
test: os: linux
arch: amd64
steps:
- name: vet
pull: always
image: golang:1.11 image: golang:1.11
pull: true
environment:
- GO111MODULE=on
commands: commands:
- go vet ./... - go vet ./...
- go test -cover ./...
build_linux_amd64:
image: golang:1.11
pull: true
group: build
environment: environment:
- GOOS=linux GO111MODULE: on
- GOARCH=amd64
- CGO_ENABLED=0 - name: test
- GO111MODULE=on pull: always
image: golang:1.11
commands: commands:
- | - go test -cover ./...
if test "${DRONE_TAG}" = ""; then environment:
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo GO111MODULE: on
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo
fi
# build_linux_arm64: trigger:
# image: golang:1.11 branch:
# pull: true - master
# group: build
# environment:
# - GOOS=linux
# - GOARCH=arm64
# - CGO_ENABLED=0
# - GO111MODULE=on
# commands:
# - |
# if test "${DRONE_TAG}" = ""; then
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo
# else
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo
# fi
# build_linux_arm: ---
# image: golang:1.11 kind: pipeline
# pull: true name: linux-amd64
# group: build
# environment:
# - GOOS=linux
# - GOARCH=arm
# - CGO_ENABLED=0
# - GOARM=7
# - GO111MODULE=on
# commands:
# - |
# if test "${DRONE_TAG}" = ""; then
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo
# else
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo
# fi
# build_linux_386: platform:
# image: golang:1.11 os: linux
# pull: true arch: amd64
# group: build
# environment:
# - GOOS=linux
# - GOARCH=386
# - CGO_ENABLED=0
# - GO111MODULE=on
# commands:
# - |
# if test "${DRONE_TAG}" = ""; then
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo
# else
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-hugo github.com/drone-plugins/drone-hugo/cmd/drone-hugo
# fi
publish_linux_amd64: steps:
image: plugins/docker:17.12 - name: build
pull: true pull: always
secrets: [ docker_username, docker_password ] image: golang:1.11
group: docker commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request
- name: build
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/amd64/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/hugo repo: plugins/hugo
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true auto_tag: true
auto_tag_suffix: linux-amd64 auto_tag_suffix: linux-amd64
dockerfile: Dockerfile dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: plugins/hugo
username:
from_secret: docker_username
when: when:
event: [ push, tag ] event:
- push
- tag
# publish_linux_arm64: trigger:
# image: plugins/docker:17.12 branch:
# pull: true - master
# secrets: [ docker_username, docker_password ]
# group: docker
# repo: plugins/hugo
# auto_tag: true
# auto_tag_suffix: linux-arm64
# dockerfile: Dockerfile.arm64
# when:
# event: [ push, tag ]
# publish_linux_arm: depends_on:
# image: plugins/docker:17.12 - testing
# pull: true
# secrets: [ docker_username, docker_password ]
# group: docker
# repo: plugins/hugo
# auto_tag: true
# auto_tag_suffix: linux-arm
# dockerfile: Dockerfile.arm
# when:
# event: [ push, tag ]
# publish_linux_386: ---
# image: plugins/docker:17.12 kind: pipeline
# pull: true name: linux-arm64
# secrets: [ docker_username, docker_password ]
# group: docker
# repo: plugins/hugo
# auto_tag: true
# auto_tag_suffix: linux-arm
# dockerfile: Dockerfile.arm
# when:
# event: [ push, tag ]
manifests: platform:
image: plugins/manifest:1 os: linux
pull: true arch: arm64
secrets: [ docker_username, docker_password ]
spec: manifest.tmpl steps:
- name: build
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm64/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request
- name: build
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm64/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:linux-arm64
settings:
dockerfile: docker/Dockerfile.linux.arm64
dry_run: true
password:
from_secret: docker_password
repo: plugins/hugo
tags: linux-arm64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-arm64
settings:
auto_tag: true auto_tag: true
ignore_missing: true auto_tag_suffix: linux-arm64
dockerfile: docker/Dockerfile.linux.arm64
password:
from_secret: docker_password
repo: plugins/hugo
username:
from_secret: docker_username
when: when:
event: [ push, tag ] event:
- push
- tag
microbadger: trigger:
image: plugins/webhook:1 branch:
pull: true - master
secrets: [ webhook_url ]
depends_on:
- testing
---
kind: pipeline
name: linux-arm
platform:
os: linux
arch: arm
steps:
- name: build
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when: when:
status: [ success ] event:
- push
- pull_request
- name: build
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/linux/arm/drone-hugo"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:linux-arm
settings:
dockerfile: docker/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/hugo
tags: linux-arm
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:linux-arm
settings:
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: plugins/hugo
username:
from_secret: docker_username
when:
event:
- push
- tag
trigger:
branch:
- master
depends_on:
- testing
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: manifest
pull: always
image: plugins/manifest:1
settings:
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook:1
settings:
url:
from_secret: microbadger_url
trigger:
branch:
- master
event:
- push
- tag
depends_on:
- linux-amd64
- linux-arm64
- linux-arm
...