Support for windows images for tags (#346)

This commit is contained in:
Shubham Agrawal 2022-01-05 23:28:27 +05:30 committed by GitHub
parent 4d8c628184
commit 85e715fd5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 570 additions and 134 deletions

View File

@ -8,7 +8,7 @@ platform:
steps:
- name: vet
image: golang:1.13
image: golang:1.17.3
commands:
- go vet ./...
environment:
@ -18,7 +18,7 @@ steps:
path: /go
- name: test
image: golang:1.13
image: golang:1.17.3
commands:
- go test -cover ./...
environment:
@ -40,7 +40,7 @@ trigger:
---
kind: pipeline
type: ssh
name: windows-1809-amd64-docker
name: windows-1809-docker
platform:
os: windows
@ -53,70 +53,194 @@ server:
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
- name: build_latest
environment:
CGO_ENABLED: "0"
VERSION: 1809
REGISTRY: docker
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
trigger:
event:
- push
- name: build_tag
environment:
VERSION: 1809
REGISTRY: docker
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
- 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
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
type: ssh
name: windows-1909-amd64-docker
name: windows-1809-ecr
platform:
os: windows
server:
host: windows.1809.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username
steps:
- name: build_latest
environment:
VERSION: 1809
REGISTRY: ecr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
- name: build_tag
environment:
VERSION: 1809
REGISTRY: ecr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
type: ssh
name: windows-1809-gcr
platform:
os: windows
server:
host: windows.1809.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username
steps:
- name: build_latest
environment:
VERSION: 1809
REGISTRY: gcr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
- name: build_tag
environment:
VERSION: 1809
REGISTRY: gcr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
type: ssh
name: windows-1809-acr
platform:
os: windows
server:
host: windows.1809.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username
steps:
- name: build_latest
environment:
VERSION: 1809
REGISTRY: acr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
- name: build_tag
environment:
VERSION: 1809
REGISTRY: acr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
type: ssh
name: windows-1909-docker
platform:
os: windows
@ -129,28 +253,190 @@ server:
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.1909 -t plugins/docker:windows-1909-amd64 .
- docker push plugins/docker:windows-1909-amd64
environment:
CGO_ENABLED: "0"
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
- name: build_latest
environment:
VERSION: 1909
REGISTRY: docker
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
trigger:
event:
- push
- name: build_tag
environment:
VERSION: 1909
REGISTRY: docker
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
type: ssh
name: windows-1909-ecr
platform:
os: windows
server:
host: windows.1909.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username
steps:
- name: build_latest
environment:
VERSION: 1909
REGISTRY: ecr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
- name: build_tag
environment:
VERSION: 1909
REGISTRY: ecr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
type: ssh
name: windows-1909-gcr
platform:
os: windows
server:
host: windows.1909.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username
steps:
- name: build_latest
environment:
VERSION: 1909
REGISTRY: gcr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
- name: build_tag
environment:
VERSION: 1909
REGISTRY: gcr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
type: ssh
name: windows-1909-acr
platform:
os: windows
server:
host: windows.1909.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username
steps:
- name: build_latest
environment:
VERSION: 1909
REGISTRY: acr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/latest.ps1
when:
event: [ push ]
- name: build_tag
environment:
VERSION: 1909
REGISTRY: acr
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
commands:
- powershell.exe scripts/windows/tag.ps1
when:
event: [ tag ]
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/*
---
kind: pipeline
name: linux-amd64-docker
@ -161,7 +447,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker"
environment:
@ -173,7 +459,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker"
environment:
@ -184,7 +470,7 @@ steps:
- tag
- name: executable
image: golang:1.13
image: golang:1.17.3
commands:
- ./release/linux/amd64/drone-docker --help
@ -224,7 +510,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker"
environment:
@ -236,7 +522,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker"
environment:
@ -247,7 +533,7 @@ steps:
- tag
- name: executable
image: golang:1.13
image: golang:1.17.3
commands:
- ./release/linux/arm64/drone-docker --help
@ -287,7 +573,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker"
environment:
@ -299,7 +585,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker"
environment:
@ -310,7 +596,7 @@ steps:
- tag
- name: executable
image: golang:1.13
image: golang:1.17.3
commands:
- ./release/linux/arm/drone-docker --help
@ -366,12 +652,11 @@ trigger:
- "refs/tags/**"
depends_on:
- windows-1809-amd64-docker
- windows-1909-amd64-docker
- windows-1809-docker
- windows-1909-docker
- linux-amd64-docker
- linux-arm64-docker
- linux-arm-docker
# - windows-1903-amd64-dfocker
---
kind: pipeline
@ -383,7 +668,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr"
environment:
@ -395,7 +680,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr"
environment:
@ -441,7 +726,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr"
environment:
@ -453,7 +738,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr"
environment:
@ -499,7 +784,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr"
environment:
@ -511,7 +796,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr"
environment:
@ -573,6 +858,8 @@ trigger:
- "refs/tags/**"
depends_on:
- windows-1809-gcr
- windows-1909-gcr
- linux-amd64-gcr
- linux-arm64-gcr
- linux-arm-gcr
@ -587,7 +874,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr"
environment:
@ -599,7 +886,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr"
environment:
@ -645,7 +932,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr"
environment:
@ -657,7 +944,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr"
environment:
@ -703,7 +990,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr"
environment:
@ -715,7 +1002,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr"
environment:
@ -777,6 +1064,8 @@ trigger:
- "refs/tags/**"
depends_on:
- windows-1809-ecr
- windows-1909-ecr
- linux-amd64-ecr
- linux-arm64-ecr
- linux-arm-ecr
@ -791,7 +1080,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku"
environment:
@ -803,7 +1092,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku"
environment:
@ -849,7 +1138,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku"
environment:
@ -861,7 +1150,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku"
environment:
@ -907,7 +1196,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku"
environment:
@ -919,7 +1208,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku"
environment:
@ -995,7 +1284,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-acr ./cmd/drone-acr"
environment:
@ -1007,7 +1296,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-acr ./cmd/drone-acr"
environment:
@ -1053,7 +1342,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-acr ./cmd/drone-acr"
environment:
@ -1065,7 +1354,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-acr ./cmd/drone-acr"
environment:
@ -1111,7 +1400,7 @@ platform:
steps:
- name: build-push
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-acr ./cmd/drone-acr"
environment:
@ -1123,7 +1412,7 @@ steps:
- tag
- name: build-tag
image: golang:1.13
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-acr ./cmd/drone-acr"
environment:
@ -1184,9 +1473,10 @@ trigger:
- "refs/tags/**"
depends_on:
- windows-1809-acr
- windows-1909-acr
- linux-amd64-acr
- linux-arm64-acr
- linux-arm-acr
...

View File

@ -1,5 +1,5 @@
# escape=`
FROM plugins/docker:windows-1803
FROM plugins/docker:windows-1803-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone ACR" `

View File

@ -1,5 +1,5 @@
# escape=`
FROM plugins/docker:windows-1809
FROM plugins/docker:windows-1809-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone ACR" `

View File

@ -0,0 +1,10 @@
# escape=`
FROM plugins/docker:windows-1909-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone ACR" `
org.label-schema.vendor="Drone.IO Community" `
org.label-schema.schema-version="1.0"
ADD release/windows/amd64/drone-acr.exe C:/bin/drone-acr.exe
ENTRYPOINT [ "C:\\bin\\drone-acr.exe" ]

View File

@ -24,14 +24,26 @@ manifests:
os: linux
variant: v7
-
image: plugins/acr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803
image: plugins/acr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803-amd64
platform:
architecture: amd64
os: windows
version: 1803
-
image: plugins/acr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809
image: plugins/acr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
platform:
architecture: amd64
os: windows
version: 1809
-
image: plugins/acr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1903-amd64
platform:
architecture: amd64
os: windows
version: 1903
-
image: plugins/acr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1909-amd64
platform:
architecture: amd64
os: windows
version: 1909

View File

@ -24,7 +24,7 @@ manifests:
os: linux
variant: v7
-
image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803
image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803-amd64
platform:
architecture: amd64
os: windows

View File

@ -1,5 +1,5 @@
# escape=`
FROM plugins/docker:windows-1803
FROM plugins/docker:windows-1803-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone ECR" `

View File

@ -1,5 +1,5 @@
# escape=`
FROM plugins/docker:windows-1809
FROM plugins/docker:windows-1809-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone ECR" `

View File

@ -0,0 +1,10 @@
# escape=`
FROM plugins/docker:windows-1909-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone ECR" `
org.label-schema.vendor="Drone.IO Community" `
org.label-schema.schema-version="1.0"
ADD release/windows/amd64/drone-ecr.exe C:/bin/drone-ecr.exe
ENTRYPOINT [ "C:\\bin\\drone-ecr.exe" ]

View File

@ -24,14 +24,26 @@ manifests:
os: linux
variant: v7
-
image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803
image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803-amd64
platform:
architecture: amd64
os: windows
version: 1803
-
image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809
image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
platform:
architecture: amd64
os: windows
version: 1809
-
image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1903-amd64
platform:
architecture: amd64
os: windows
version: 1903
-
image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1909-amd64
platform:
architecture: amd64
os: windows
version: 1909

View File

@ -1,5 +1,5 @@
# escape=`
FROM plugins/docker:windows-1803
FROM plugins/docker:windows-1803-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone GCR" `

View File

@ -1,5 +1,5 @@
# escape=`
FROM plugins/docker:windows-1809
FROM plugins/docker:windows-1809-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone GCR" `

View File

@ -0,0 +1,10 @@
# escape=`
FROM plugins/docker:windows-1909-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone GCR" `
org.label-schema.vendor="Drone.IO Community" `
org.label-schema.schema-version="1.0"
ADD release/windows/amd64/drone-gcr.exe C:/bin/drone-gcr.exe
ENTRYPOINT [ "C:\\bin\\drone-gcr.exe" ]

View File

@ -24,14 +24,20 @@ manifests:
os: linux
variant: v7
-
image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803
image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803-amd64
platform:
architecture: amd64
os: windows
version: 1803
-
image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809
image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
platform:
architecture: amd64
os: windows
version: 1809
-
image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1909-amd64
platform:
architecture: amd64
os: windows
version: 1909

16
go.mod
View File

@ -2,12 +2,20 @@ module github.com/drone-plugins/drone-docker
require (
github.com/aws/aws-sdk-go v1.26.7
github.com/coreos/go-semver v0.2.0
github.com/coreos/go-semver v0.3.0
github.com/joho/godotenv v1.3.0
github.com/sirupsen/logrus v1.3.0
github.com/urfave/cli v1.22.2
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e // indirect
golang.org/x/text v0.3.0 // indirect
)
go 1.13
require (
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 // indirect
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 // indirect
)
go 1.17

11
go.sum
View File

@ -1,8 +1,8 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aws/aws-sdk-go v1.26.7 h1:ObjEnmzvSdYy8KVd3me7v/UMyCn81inLy2SyoIPoBkg=
github.com/aws/aws-sdk-go v1.26.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@ -24,19 +24,12 @@ github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

View File

@ -0,0 +1,30 @@
# this script is used by the continuous integration server to
# build and publish the docker image for a commit to master.
$env:GOOS="windows"
$env:GOARCH="amd64"
$env:CGO_ENABLED="0"
if (-not (Test-Path env:VERSION)) {
$env:VERSION="1809"
}
if (-not (Test-Path env:REGISTRY)) {
$env:REGISTRY="docker"
}
echo $env:GOOS
echo $env:GOARCH
echo $env:VERSION
# build the binary
go build -o release/windows/amd64/drone-$env:REGISTRY.exe
# build and publish the docker image
docker login -u $env:USERNAME -p $env:PASSWORD
docker build -f docker/$env:REGISTRY/Dockerfile.windows.amd64.$env:VERSION -t plugins/$env:REGISTRY:windows-$env:VERSION-amd64 .
docker push plugins/$env:REGISTRY:windows-$env:VERSION-amd64
# remove images from local cache
docker rmi plugins/$env:REGISTRY:windows-$env:VERSION-amd64

55
scripts/windows/tag.ps1 Normal file
View File

@ -0,0 +1,55 @@
# this script is used by the continuous integration server to
# build and publish the docker image for a tagged revsision.
$env:GOOS="windows"
$env:GOARCH="amd64"
$env:CGO_ENABLED="0"
if (-not (Test-Path env:VERSION)) {
$env:VERSION="1809"
}
if (-not (Test-Path env:DRONE_SEMVER_SHORT)) {
echo "missing semver"
exit 1
}
if (-not (Test-Path env:REGISTRY)) {
$env:REGISTRY="docker"
}
# define the image tags
$env:IMAGE_PATCH="plugins/$env:REGISTRY:$env:DRONE_SEMVER_SHORT-windows-$env:VERSION-amd64"
$env:IMAGE_MAJOR="plugins/$env:REGISTRY:$env:DRONE_SEMVER_MAJOR-windows-$env:VERSION-amd64"
$env:IMAGE_MINOR="plugins/$env:REGISTRY:$env:DRONE_SEMVER_MAJOR.$env:DRONE_SEMVER_MINOR-windows-$env:VERSION-amd64"
echo "build environment:"
echo $env:GOOS
echo $env:GOARCH
echo $env:VERSION
# build the binary
go build -o release/windows/amd64/drone-$env:REGISTRY.exe
# authenticate with the docker registry
docker login -u $env:USERNAME -p $env:PASSWORD
echo "building images:"
echo $env:IMAGE_PATCH
echo $env:IMAGE_MINOR
echo $env:IMAGE_MAJOR
# build and tag the docker images
docker build -f docker/$env:REGISTRY/Dockerfile.windows.amd64.$env:VERSION -t $env:IMAGE_PATCH .
docker tag $env:IMAGE_PATCH $env:IMAGE_MAJOR
docker tag $env:IMAGE_PATCH $env:IMAGE_MINOR
# publish the docker images
docker push $env:IMAGE_MAJOR
docker push $env:IMAGE_MINOR
docker push $env:IMAGE_PATCH
# remove images after from local cache
docker rmi $env:IMAGE_MAJOR
docker rmi $env:IMAGE_MINOR
docker rmi $env:IMAGE_PATCH