Add a reliable version and integrate libsonnet definition

This commit is contained in:
Thomas Boerger 2019-02-14 23:53:36 +01:00
commit b5e1a12f60
No known key found for this signature in database
GPG key ID: 09745AFF9D63C79B
6 changed files with 495 additions and 220 deletions

View file

@ -1,30 +1,73 @@
---
kind: pipeline
name: windows-amd64
name: testing
platform:
os: windows
arch: amd64
version: 1803
steps:
- name: vet
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- go vet ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: C:\\gopath
- name: test
pull: always
image: golang:1.11-windowsservercore-1803
commands:
- go test -cover ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: C:\\gopath
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
---
kind: pipeline
name: windows-1803
platform:
os: windows
arch: amd64
version: 1803
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-hugo" ./cmd/drone-hugo
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-hugo.exe"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- push
- pull_request
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.11-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-hugo" ./cmd/drone-hugo
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-hugo.exe"
environment:
CGO_ENABLED: 0
GO111MODULE: on
@ -34,43 +77,196 @@ steps:
- name: executable
pull: always
image: golang:1.11
image: golang:1.11-windowsservercore-1803
commands:
- ./release/windows/amd64/drone-hugo --help
- ./release/windows/amd64/drone-hugo.exe --help
- name: dryrun
pull: always
image: plugins/docker:windows-amd64
image: plugins/docker:windows-1803
settings:
dockerfile: docker/Dockerfile.windows.amd64
daemon_off: true
dockerfile: docker/Dockerfile.windows.1803
dry_run: true
password:
from_secret: docker_password
repo: plugins/hugo
tags: windows-amd64
tags: windows-1803
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-amd64
image: plugins/docker:windows-1803
settings:
auto_tag: true
auto_tag_suffix: windows-amd64
dockerfile: docker/Dockerfile.windows.amd64
auto_tag_suffix: windows-1803
daemon_off: true
dockerfile: docker/Dockerfile.windows.1803
password:
from_secret: docker_password
repo: plugins/hugo
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- push
- tag
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
branch:
- master
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- testing
---
kind: pipeline
name: windows-1809
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-hugo.exe"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-hugo.exe"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag
- name: executable
pull: always
image: golang:1.11-windowsservercore-1809
commands:
- ./release/windows/amd64/drone-hugo.exe --help
- name: dryrun
pull: always
image: plugins/docker:windows-1809
settings:
daemon_off: true
dockerfile: docker/Dockerfile.windows.1809
dry_run: true
password:
from_secret: docker_password
repo: plugins/hugo
tags: windows-1809
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:windows-1809
settings:
auto_tag: true
auto_tag_suffix: windows-1809
daemon_off: true
dockerfile: docker/Dockerfile.windows.1809
password:
from_secret: docker_password
repo: plugins/hugo
username:
from_secret: docker_username
volumes:
- name: docker_pipe
path: \\\\.\\pipe\\docker_engine
when:
event:
exclude:
- pull_request
volumes:
- name: docker_pipe
host:
path: \\\\.\\pipe\\docker_engine
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
- "refs/pull/**"
depends_on:
- testing
---
kind: pipeline
name: notifications
platform:
os: windows
arch: amd64
version: 1809
steps:
- name: manifest
pull: always
image: plugins/manifest
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
settings:
url:
from_secret: microbadger_url
trigger:
ref:
- refs/heads/master
- "refs/tags/**"
depends_on:
- windows-1803
- windows-1809
...