diff --git a/.drone.windows.yml b/.drone.windows.yml index 1f7b9ae..de68b2f 100644 --- a/.drone.windows.yml +++ b/.drone.windows.yml @@ -1,17 +1,44 @@ --- 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 + +- name: test + pull: always + image: golang:1.11-windowsservercore-1803 + commands: + - go test -cover ./... + environment: + GO111MODULE: on + +--- +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-webhook" + - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-webhook.exe" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -22,9 +49,9 @@ steps: - 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-webhook" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-webhook.exe" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -34,43 +61,195 @@ steps: - name: executable pull: always - image: golang:1.11 + image: golang:1.11-windowsservercore-1803 commands: - - ./release/windows/amd64/drone-webhook --help + - ./release/windows/amd64/drone-webhook.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/webhook - 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/webhook username: from_secret: docker_username + volumes: + - name: docker_pipe + path: \\\\.\\pipe\\docker_engine when: event: - push - - tag + +volumes: +- name: docker_pipe + host: + path: \\\\.\\pipe\\docker_engine trigger: branch: - master + +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.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-webhook.exe" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + pull: always + image: golang:1.11-windowsservercore-1809 + commands: + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-webhook.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-webhook.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/webhook + 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/webhook + username: + from_secret: docker_username + volumes: + - name: docker_pipe + path: \\\\.\\pipe\\docker_engine + when: + event: + - push + +volumes: +- name: docker_pipe + host: + path: \\\\.\\pipe\\docker_engine + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: notifications + +platform: + os: windows + arch: amd64 + version: 1809 + +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 + when: + event: + - push + +- name: microbadger + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_url + when: + event: + - push + +trigger: + branch: + - master + +depends_on: +- windows-1803 +- windows-1809 + +...