Skip to content

Commit

Permalink
Merge pull request #21 from drone-plugins/upgrade-drone
Browse files Browse the repository at this point in the history
Upgrade and switch to Drone 1.0.0
  • Loading branch information
tboerger committed Jan 23, 2019
2 parents a73118f + 58d5e41 commit 477c7ee
Show file tree
Hide file tree
Showing 13 changed files with 632 additions and 221 deletions.
66 changes: 0 additions & 66 deletions .appveyor.yml

This file was deleted.

169 changes: 169 additions & 0 deletions .drone.jsonnet
@@ -0,0 +1,169 @@
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-push",
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-volume-cache",
],
when: {
event: [ "push", "pull_request" ],
},
},
{
name: "build-tag",
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-volume-cache",
],
when: {
event: [ "tag" ],
},
},
{
name: "executable",
image: "golang:1.11",
pull: "always",
commands: [
"./release/" + os + "/" + arch + "/drone-volume-cache --help",
],
},
{
name: "dryrun",
image: "plugins/docker:" + os + "-" + arch,
pull: "always",
settings: {
dry_run: true,
tags: os + "-" + arch,
dockerfile: "docker/Dockerfile." + os + "." + arch,
repo: "plugins/volume-cache",
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/volume-cache",
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,
]
76 changes: 76 additions & 0 deletions .drone.windows.yml
@@ -0,0 +1,76 @@
---
kind: pipeline
name: windows-amd64

platform:
os: windows
arch: amd64

steps:
- name: build-push
pull: always
image: golang:1.11
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-volume-cache"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request

- name: build-tag
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/windows/amd64/drone-volume-cache"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag

- name: executable
pull: always
image: golang:1.11
commands:
- ./release/windows/amd64/drone-volume-cache --help

- name: dryrun
pull: always
image: plugins/docker:windows-amd64
settings:
dockerfile: docker/Dockerfile.windows.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/volume-cache
tags: windows-amd64
username:
from_secret: docker_username
when:
event:
- pull_request

- name: publish
pull: always
image: plugins/docker:windows-amd64
settings:
auto_tag: true
auto_tag_suffix: windows-amd64
dockerfile: docker/Dockerfile.windows.amd64
password:
from_secret: docker_password
repo: plugins/volume-cache
username:
from_secret: docker_username
when:
event:
- push
- tag

trigger:
branch:
- master

0 comments on commit 477c7ee

Please sign in to comment.