diff --git a/.drone.windows.jsonnet b/.drone.windows.jsonnet deleted file mode 100644 index 23475af..0000000 --- a/.drone.windows.jsonnet +++ /dev/null @@ -1,33 +0,0 @@ -local pipeline = import 'pipeline.libsonnet'; - -[ - pipeline.test('windows', 'amd64', '1803'), - - pipeline.build('docker', 'windows', 'amd64', '1803'), - pipeline.build('docker', 'windows', 'amd64', '1809'), - pipeline.notifications('docker', 'windows', 'amd64', '1809', [ - 'windows-1803', - 'windows-1809' - ]), - - pipeline.build('gcr', 'windows', 'amd64', '1803'), - pipeline.build('gcr', 'windows', 'amd64', '1809'), - pipeline.notifications('gcr', 'windows', 'amd64', '1809', [ - 'windows-1803', - 'windows-1809' - ]), - - pipeline.build('acr', 'windows', 'amd64', '1803'), - pipeline.build('acr', 'windows', 'amd64', '1809'), - pipeline.notifications('acr', 'windows', 'amd64', '1809', [ - 'windows-1803', - 'windows-1809' - ]), - - pipeline.build('ecr', 'windows', 'amd64', '1803'), - pipeline.build('ecr', 'windows', 'amd64', '1809'), - pipeline.notifications('ecr', 'windows', 'amd64', '1809', [ - 'windows-1803', - 'windows-1809' - ]), -] diff --git a/.drone.windows.yml b/.drone.windows.yml deleted file mode 100644 index ab11bfe..0000000 --- a/.drone.windows.yml +++ /dev/null @@ -1,926 +0,0 @@ ---- -kind: pipeline -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-docker - -platform: - os: windows - arch: amd64 - version: 1803 - -steps: -- name: build-push - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: executable - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - ./release/windows/amd64/drone-docker.exe --help - -- name: dryrun - pull: always - image: plugins/docker:windows-1803 - settings: - daemon_off: true - dockerfile: docker/docker/Dockerfile.windows.1803 - dry_run: true - password: - from_secret: docker_password - repo: plugins/docker - 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-1803 - settings: - auto_tag: true - auto_tag_suffix: windows-1803 - daemon_off: true - dockerfile: docker/docker/Dockerfile.windows.1803 - password: - from_secret: docker_password - repo: plugins/docker - 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: windows-1809-docker - -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-docker.exe ./cmd/drone-docker" - 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-docker.exe ./cmd/drone-docker" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: executable - pull: always - image: golang:1.11-windowsservercore-1809 - commands: - - ./release/windows/amd64/drone-docker.exe --help - -- name: dryrun - pull: always - image: plugins/docker:windows-1809 - settings: - daemon_off: true - dockerfile: docker/docker/Dockerfile.windows.1809 - dry_run: true - password: - from_secret: docker_password - repo: plugins/docker - 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/docker/Dockerfile.windows.1809 - password: - from_secret: docker_password - repo: plugins/docker - 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-docker - -platform: - os: windows - arch: amd64 - version: 1809 - -steps: -- name: manifest - pull: always - image: plugins/manifest - settings: - auto_tag: true - ignore_missing: true - password: - from_secret: docker_password - spec: docker/docker/manifest.tmpl - username: - from_secret: docker_username - -- name: microbadger - pull: always - image: plugins/webhook - settings: - urls: - from_secret: microbadger_docker - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- windows-1803-docker -- windows-1809-docker - ---- -kind: pipeline -name: windows-1803-gcr - -platform: - os: windows - arch: amd64 - version: 1803 - -steps: -- name: build-push - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:windows-1803 - settings: - daemon_off: true - dockerfile: docker/gcr/Dockerfile.windows.1803 - dry_run: true - password: - from_secret: docker_password - repo: plugins/gcr - 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-1803 - settings: - auto_tag: true - auto_tag_suffix: windows-1803 - daemon_off: true - dockerfile: docker/gcr/Dockerfile.windows.1803 - password: - from_secret: docker_password - repo: plugins/gcr - 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: -- windows-1803-docker - ---- -kind: pipeline -name: windows-1809-gcr - -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-gcr.exe ./cmd/drone-gcr" - 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-gcr.exe ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:windows-1809 - settings: - daemon_off: true - dockerfile: docker/gcr/Dockerfile.windows.1809 - dry_run: true - password: - from_secret: docker_password - repo: plugins/gcr - 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/gcr/Dockerfile.windows.1809 - password: - from_secret: docker_password - repo: plugins/gcr - 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: -- windows-1809-docker - ---- -kind: pipeline -name: notifications-gcr - -platform: - os: windows - arch: amd64 - version: 1809 - -steps: -- name: manifest - pull: always - image: plugins/manifest - settings: - auto_tag: true - ignore_missing: true - password: - from_secret: docker_password - spec: docker/gcr/manifest.tmpl - username: - from_secret: docker_username - -- name: microbadger - pull: always - image: plugins/webhook - settings: - urls: - from_secret: microbadger_gcr - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- windows-1803-gcr -- windows-1809-gcr - ---- -kind: pipeline -name: windows-1803-ecr - -platform: - os: windows - arch: amd64 - version: 1803 - -steps: -- name: build-push - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:windows-1803 - settings: - daemon_off: true - dockerfile: docker/ecr/Dockerfile.windows.1803 - dry_run: true - password: - from_secret: docker_password - repo: plugins/ecr - 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-1803 - settings: - auto_tag: true - auto_tag_suffix: windows-1803 - daemon_off: true - dockerfile: docker/ecr/Dockerfile.windows.1803 - password: - from_secret: docker_password - repo: plugins/ecr - 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: -- windows-1803-docker - ---- -kind: pipeline -name: windows-1809-ecr - -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-ecr.exe ./cmd/drone-ecr" - 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-ecr.exe ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:windows-1809 - settings: - daemon_off: true - dockerfile: docker/ecr/Dockerfile.windows.1809 - dry_run: true - password: - from_secret: docker_password - repo: plugins/ecr - 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/ecr/Dockerfile.windows.1809 - password: - from_secret: docker_password - repo: plugins/ecr - 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: -- windows-1809-docker - ---- -kind: pipeline -name: notifications-ecr - -platform: - os: windows - arch: amd64 - version: 1809 - -steps: -- name: manifest - pull: always - image: plugins/manifest - settings: - auto_tag: true - ignore_missing: true - password: - from_secret: docker_password - spec: docker/ecr/manifest.tmpl - username: - from_secret: docker_username - -- name: microbadger - pull: always - image: plugins/webhook - settings: - urls: - from_secret: microbadger_ecr - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- windows-1803-ecr -- windows-1809-ecr - ---- -kind: pipeline -name: windows-1803-acr - -platform: - os: windows - arch: amd64 - version: 1803 - -steps: -- name: build-push - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11-windowsservercore-1803 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:windows-1803 - settings: - daemon_off: true - dockerfile: docker/acr/Dockerfile.windows.1803 - dry_run: true - password: - from_secret: docker_password - repo: plugins/acr - 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-1803 - settings: - auto_tag: true - auto_tag_suffix: windows-1803 - daemon_off: true - dockerfile: docker/acr/Dockerfile.windows.1803 - password: - from_secret: docker_password - repo: plugins/acr - 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: -- windows-1803-docker - ---- -kind: pipeline -name: windows-1809-acr - -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 -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr" - 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} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:windows-1809 - settings: - daemon_off: true - dockerfile: docker/acr/Dockerfile.windows.1809 - dry_run: true - password: - from_secret: docker_password - repo: plugins/acr - 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/acr/Dockerfile.windows.1809 - password: - from_secret: docker_password - repo: plugins/acr - 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: -- windows-1809-docker - ---- -kind: pipeline -name: notifications-acr - -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/acr/manifest.tmpl - username: - from_secret: docker_username - -- name: microbadger - pull: always - image: plugins/webhook - settings: - url: - from_secret: microbadger_acr - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- windows-1803-acr -- windows-1809-acr - -... diff --git a/.drone.yml b/.drone.yml index fdb4069..0d3b2fe 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,6 +39,82 @@ trigger: - "refs/tags/**" - "refs/pull/**" +--- +kind: pipeline +type: ssh +name: windows-1809-amd64-docker + +platform: + os: windows + +server: + host: windows.1809.amd64.plugins.drone.ci + password: + from_secret: windows_password + user: + from_secret: windows_username + +steps: +- name: build + commands: + # TODO use the new DRONE_SEMVER_SHORT environment variables to + # publish docker images for tag events. + - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker + - docker login -u $env:USERNAME -p $env:PASSWORD + - docker build -f docker/docker/Dockerfile.windows.1809 -t plugins/docker:windows-1809-amd64 . + - docker push plugins/docker:windows-1809-amd64 + environment: + CGO_ENABLED: "0" + USERNAME: + from_secret: docker_username + PASSWORD: + from_secret: docker_password + +trigger: + event: + - push + +depends_on: +- testing + +--- +kind: pipeline +type: ssh +name: windows-1903-amd64-docker + +platform: + os: windows + +server: + host: windows.1903.amd64.plugins.drone.ci + password: + from_secret: windows_password + user: + from_secret: windows_username + +steps: +- name: build + commands: + # TODO use the new DRONE_SEMVER_SHORT environment variables to + # publish docker images for tag events. + - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker + - docker login -u $env:USERNAME -p $env:PASSWORD + - docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 . + - docker push plugins/docker:windows-1903-amd64 + environment: + CGO_ENABLED: "0" + USERNAME: + from_secret: docker_username + PASSWORD: + from_secret: docker_password + +trigger: + event: + - push + +depends_on: +- testing + --- kind: pipeline name: linux-amd64-docker @@ -81,7 +157,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/docker/Dockerfile.linux.amd64 @@ -98,7 +174,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-amd64 @@ -165,7 +241,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/docker/Dockerfile.linux.arm64 @@ -182,7 +258,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm64 @@ -249,7 +325,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/docker/Dockerfile.linux.arm @@ -266,7 +342,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm @@ -315,6 +391,7 @@ steps: - name: microbadger pull: always image: plugins/webhook + failure: ignore settings: urls: from_secret: microbadger_docker @@ -325,6 +402,8 @@ trigger: - "refs/tags/**" depends_on: +- windows-1809-amd64-docker +- windows-1903-amd64-docker - linux-amd64-docker - linux-arm64-docker - linux-arm-docker @@ -365,7 +444,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/gcr/Dockerfile.linux.amd64 @@ -382,7 +461,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-amd64 @@ -443,7 +522,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/gcr/Dockerfile.linux.arm64 @@ -460,7 +539,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm64 @@ -521,7 +600,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/gcr/Dockerfile.linux.arm @@ -538,7 +617,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm @@ -587,6 +666,7 @@ steps: - name: microbadger pull: always image: plugins/webhook + failure: ignore settings: urls: from_secret: microbadger_gcr @@ -637,7 +717,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/ecr/Dockerfile.linux.amd64 @@ -654,7 +734,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-amd64 @@ -715,7 +795,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/ecr/Dockerfile.linux.arm64 @@ -732,7 +812,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm64 @@ -793,7 +873,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/ecr/Dockerfile.linux.arm @@ -810,7 +890,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm @@ -859,6 +939,7 @@ steps: - name: microbadger pull: always image: plugins/webhook + failure: ignore settings: urls: from_secret: microbadger_ecr @@ -909,7 +990,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/heroku/Dockerfile.linux.amd64 @@ -926,7 +1007,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-amd64 @@ -987,7 +1068,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/heroku/Dockerfile.linux.arm64 @@ -1004,7 +1085,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm64 @@ -1065,7 +1146,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/heroku/Dockerfile.linux.arm @@ -1082,7 +1163,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm @@ -1131,6 +1212,7 @@ steps: - name: microbadger pull: always image: plugins/webhook + failure: ignore settings: urls: from_secret: microbadger_heroku @@ -1181,7 +1263,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/acr/Dockerfile.linux.amd64 @@ -1198,7 +1280,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-amd64 @@ -1259,7 +1341,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/acr/Dockerfile.linux.arm64 @@ -1276,7 +1358,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm64 + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm64 @@ -1337,7 +1419,7 @@ steps: - name: dryrun pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: daemon_off: false dockerfile: docker/acr/Dockerfile.linux.arm @@ -1354,7 +1436,7 @@ steps: - name: publish pull: always - image: plugins/docker:linux-arm + image: plugins/docker:18 settings: auto_tag: true auto_tag_suffix: linux-arm @@ -1402,6 +1484,7 @@ steps: - name: microbadger pull: always image: plugins/webhook + failure: ignore settings: url: from_secret: microbadger_acr diff --git a/daemon.go b/daemon.go new file mode 100644 index 0000000..5bf1119 --- /dev/null +++ b/daemon.go @@ -0,0 +1,26 @@ +// +build !windows + +package docker + +import ( + "io/ioutil" + "os" +) + +const dockerExe = "/usr/local/bin/docker" +const dockerdExe = "/usr/local/bin/dockerd" + +func (p Plugin) startDaemon() { + cmd := commandDaemon(p.Daemon) + if p.Daemon.Debug { + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + } else { + cmd.Stdout = ioutil.Discard + cmd.Stderr = ioutil.Discard + } + go func() { + trace(cmd) + cmd.Run() + }() +} \ No newline at end of file diff --git a/daemon_win.go b/daemon_win.go new file mode 100644 index 0000000..062cf5e --- /dev/null +++ b/daemon_win.go @@ -0,0 +1,10 @@ +// +build windows + +package docker + +const dockerExe = "C:\\bin\\docker.exe" +const dockerdExe = "" + +func (p Plugin) startDaemon() { + // this is a no-op on windows +} diff --git a/docker.go b/docker.go index e6e5386..9c2a136 100644 --- a/docker.go +++ b/docker.go @@ -2,7 +2,6 @@ package docker import ( "fmt" - "io/ioutil" "os" "os/exec" "strings" @@ -69,18 +68,7 @@ type ( func (p Plugin) Exec() error { // start the Docker daemon server if !p.Daemon.Disabled { - cmd := commandDaemon(p.Daemon) - if p.Daemon.Debug { - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - } else { - cmd.Stdout = ioutil.Discard - cmd.Stderr = ioutil.Discard - } - go func() { - trace(cmd) - cmd.Run() - }() + p.startDaemon() } // poll the docker daemon until it is started. This ensures the daemon is @@ -154,9 +142,6 @@ func (p Plugin) Exec() error { return nil } -const dockerExe = "/usr/local/bin/docker" -const dockerdExe = "/usr/local/bin/dockerd" - // helper function to create the docker login command. func commandLogin(login Login) *exec.Cmd { if login.Email != "" { diff --git a/docker/docker/Dockerfile.linux.amd64 b/docker/docker/Dockerfile.linux.amd64 index 23e4c7a..08828af 100644 --- a/docker/docker/Dockerfile.linux.amd64 +++ b/docker/docker/Dockerfile.linux.amd64 @@ -1,4 +1,4 @@ -FROM docker:18.09-dind +FROM docker:18.09.0-dind ADD release/linux/amd64/drone-docker /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"] diff --git a/docker/docker/Dockerfile.linux.arm b/docker/docker/Dockerfile.linux.arm index 72b2d8a..64f7a5f 100644 --- a/docker/docker/Dockerfile.linux.arm +++ b/docker/docker/Dockerfile.linux.arm @@ -1,4 +1,4 @@ -FROM arm32v6/docker:18.09-dind +FROM arm32v6/docker:18.09.0-dind ADD release/linux/arm/drone-docker /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"] diff --git a/docker/docker/Dockerfile.linux.arm64 b/docker/docker/Dockerfile.linux.arm64 index c9a7fc7..08ab1d8 100644 --- a/docker/docker/Dockerfile.linux.arm64 +++ b/docker/docker/Dockerfile.linux.arm64 @@ -1,4 +1,4 @@ -FROM arm64v8/docker:18.09-dind +FROM arm64v8/docker:18.09.0-dind ADD release/linux/arm64/drone-docker /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"] diff --git a/docker/docker/Dockerfile.windows.1809 b/docker/docker/Dockerfile.windows.1809 index 647ec42..bffc4b4 100644 --- a/docker/docker/Dockerfile.windows.1809 +++ b/docker/docker/Dockerfile.windows.1809 @@ -13,7 +13,8 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Invoke-WebRequest $('https://github.com/docker/toolbox/releases/download/v{0}/DockerToolbox-{0}.exe' -f $env:DOCKER_VERSION) -OutFile 'dockertoolbox.exe' -UseBasicParsing RUN /innoextract.exe dockertoolbox.exe -FROM plugins/base:windows-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 +USER ContainerAdministrator LABEL maintainer="Drone.IO Community " ` org.label-schema.name="Drone Docker" ` diff --git a/docker/docker/Dockerfile.windows.1903 b/docker/docker/Dockerfile.windows.1903 new file mode 100644 index 0000000..a6eadef --- /dev/null +++ b/docker/docker/Dockerfile.windows.1903 @@ -0,0 +1,28 @@ +# escape=` +FROM mcr.microsoft.com/windows/servercore:1903 as download + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV DOCKER_VERSION 19.03.1 + +RUN Invoke-WebRequest 'http://constexpr.org/innoextract/files/innoextract-1.7-windows.zip' -OutFile 'innoextract.zip' -UseBasicParsing ; ` + Expand-Archive innoextract.zip -DestinationPath C:\ ; ` + Remove-Item -Path innoextract.zip + +RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` + Invoke-WebRequest $('https://github.com/docker/toolbox/releases/download/v{0}/DockerToolbox-{0}.exe' -f $env:DOCKER_VERSION) -OutFile 'dockertoolbox.exe' -UseBasicParsing +RUN /innoextract.exe dockertoolbox.exe + +FROM mcr.microsoft.com/windows/nanoserver:1903 +USER ContainerAdministrator + +LABEL maintainer="Drone.IO Community " ` + org.label-schema.name="Drone Docker" ` + org.label-schema.vendor="Drone.IO Community" ` + org.label-schema.schema-version="1.0" + +RUN mkdir C:\bin +COPY --from=download /windows/system32/netapi32.dll /windows/system32/netapi32.dll +COPY --from=download /app/docker.exe C:/bin/docker.exe +ADD release/windows/amd64/drone-docker.exe C:/bin/drone-docker.exe +ENTRYPOINT [ "C:\\bin\\drone-docker.exe" ] diff --git a/docker/docker/manifest.tmpl b/docker/docker/manifest.tmpl index 8a823f9..fa9d454 100644 --- a/docker/docker/manifest.tmpl +++ b/docker/docker/manifest.tmpl @@ -30,8 +30,14 @@ manifests: os: windows version: 1803 - - image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809 + image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64 platform: architecture: amd64 os: windows version: 1809 + - + image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1903-amd64 + platform: + architecture: amd64 + os: windows + version: 1903