12 Commits

Author SHA1 Message Date
Brad Rydzewski 3f387227b5 bump template lib and fix manifest trimPrefix 2019-08-22 13:16:53 -07:00
Brad Rydzewski bd53675813 remove microbadger [ci skip] 2019-08-22 13:04:41 -07:00
Brad Rydzewski 3091c4a002 update manifest template 2019-08-22 13:02:25 -07:00
Thomas Boerger f92bc07dad Merge pull request #26 from deitch/fix-push-args
add from-args
2019-06-21 09:20:18 +02:00
Avi Deitcher 5b15413fc2 add from-args 2019-06-06 14:34:53 +03:00
Don af2017d35c Fix 1803 image 2019-04-25 17:58:29 -07:00
Don 5e8ab59d01 Use base again 2019-04-25 17:55:08 -07:00
Don 18cf775bd3 Fix Tls for Github 2019-04-25 17:31:35 -07:00
Don aaa402cdff Modify shell 2019-04-25 17:19:11 -07:00
Don bed8b9a1b2 Try servercore 2019-04-25 17:11:26 -07:00
Don e957ab3e04 Use 1809 for testing on windows 2019-04-25 16:46:56 -07:00
Don b548a9c07b Update windows build 2019-04-25 16:45:09 -07:00
8 changed files with 55 additions and 33 deletions
+18 -18
View File
@@ -5,12 +5,12 @@ name: testing
platform:
os: windows
arch: amd64
version: 1803
version: 1809
steps:
- name: vet
pull: always
image: golang:1.11-windowsservercore-1803
image: golang:1.12-windowsservercore-1809
commands:
- go vet ./...
environment:
@@ -21,7 +21,7 @@ steps:
- name: test
pull: always
image: golang:1.11-windowsservercore-1803
image: golang:1.12-windowsservercore-1809
commands:
- go test -cover ./...
environment:
@@ -52,7 +52,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1803
image: golang:1.12-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-manifest.exe"
environment:
@@ -65,7 +65,7 @@ steps:
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1803
image: golang:1.12-windowsservercore-1803
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-manifest.exe"
environment:
@@ -77,13 +77,13 @@ steps:
- name: executable
pull: always
image: golang:1.11-windowsservercore-1803
image: golang:1.12-windowsservercore-1803
commands:
- ./release/windows/amd64/drone-manifest.exe --help
- name: dryrun
pull: always
image: plugins/docker:windows-1803
image: plugins/docker
settings:
daemon_off: true
dockerfile: docker/Dockerfile.windows.1803
@@ -91,7 +91,7 @@ steps:
password:
from_secret: docker_password
repo: plugins/manifest
tags: windows-1803
tags: windows-1803-amd64
username:
from_secret: docker_username
volumes:
@@ -103,10 +103,10 @@ steps:
- name: publish
pull: always
image: plugins/docker:windows-1803
image: plugins/docker
settings:
auto_tag: true
auto_tag_suffix: windows-1803
auto_tag_suffix: windows-1803-amd64
daemon_off: true
dockerfile: docker/Dockerfile.windows.1803
password:
@@ -148,7 +148,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11-windowsservercore-1809
image: golang:1.12-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-manifest.exe"
environment:
@@ -161,7 +161,7 @@ steps:
- name: build-tag
pull: always
image: golang:1.11-windowsservercore-1809
image: golang:1.12-windowsservercore-1809
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-manifest.exe"
environment:
@@ -173,13 +173,13 @@ steps:
- name: executable
pull: always
image: golang:1.11-windowsservercore-1809
image: golang:1.12-windowsservercore-1809
commands:
- ./release/windows/amd64/drone-manifest.exe --help
- name: dryrun
pull: always
image: plugins/docker:windows-1809
image: plugins/docker
settings:
daemon_off: true
dockerfile: docker/Dockerfile.windows.1809
@@ -187,7 +187,7 @@ steps:
password:
from_secret: docker_password
repo: plugins/manifest
tags: windows-1809
tags: windows-1809-amd64
username:
from_secret: docker_username
volumes:
@@ -199,10 +199,10 @@ steps:
- name: publish
pull: always
image: plugins/docker:windows-1809
image: plugins/docker
settings:
auto_tag: true
auto_tag_suffix: windows-1809
auto_tag_suffix: windows-1809-amd64
daemon_off: true
dockerfile: docker/Dockerfile.windows.1809
password:
@@ -257,7 +257,7 @@ steps:
pull: always
image: plugins/webhook
settings:
url:
urls:
from_secret: microbadger_url
trigger:
-7
View File
@@ -311,13 +311,6 @@ steps:
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
settings:
url:
from_secret: microbadger_url
trigger:
ref:
- refs/heads/master
+4 -1
View File
@@ -1,5 +1,7 @@
# escape=`
FROM plugins/base:windows-1803
FROM plugins/base:windows-1803-amd64
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone Manifest" `
@@ -9,6 +11,7 @@ LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
ENV MANIFEST_TOOL_VERSION 0.9.0
RUN New-Item -ItemType directory -Path 'C:/bin'; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
Invoke-WebRequest ('https://github.com/estesp/manifest-tool/releases/download/v{0}/manifest-tool-windows-amd64.exe' -f $env:MANIFEST_TOOL_VERSION) -OutFile 'C:/bin/manifest-tool.exe';
ADD release/windows/amd64/drone-manifest.exe C:/bin/drone-manifest.exe
+4 -1
View File
@@ -1,5 +1,7 @@
# escape=`
FROM plugins/base:windows-1809
FROM plugins/base:windows-1809-amd64
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone Manifest" `
@@ -9,6 +11,7 @@ LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
ENV MANIFEST_TOOL_VERSION 0.9.0
RUN New-Item -ItemType directory -Path 'C:/bin'; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
Invoke-WebRequest ('https://github.com/estesp/manifest-tool/releases/download/v{0}/manifest-tool-windows-amd64.exe' -f $env:MANIFEST_TOOL_VERSION) -OutFile 'C:/bin/manifest-tool.exe';
ADD release/windows/amd64/drone-manifest.exe C:/bin/drone-manifest.exe
+2 -2
View File
@@ -24,13 +24,13 @@ manifests:
os: linux
variant: v7
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803-amd64
platform:
architecture: amd64
os: windows
version: 1803
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
platform:
architecture: amd64
os: windows
+2 -3
View File
@@ -1,12 +1,11 @@
module github.com/drone-plugins/drone-manifest
require (
bou.ke/monkey v1.0.1 // indirect
github.com/bouk/monkey v1.0.0 // indirect
github.com/coreos/go-semver v0.2.0
github.com/drone/drone-template-lib v1.0.0
github.com/drone/drone-template-lib v0.0.0-20190801203641-b3f90dc7cabc
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.3.0 // indirect
github.com/tkuchiki/faketime v0.1.1 // indirect
github.com/urfave/cli v0.0.0-20180821064027-934abfb2f102
gopkg.in/yaml.v2 v2.2.2 // indirect
)
+13
View File
@@ -5,16 +5,22 @@ github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITg
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.18.0+incompatible h1:QoGhlbC6pter1jxKnjMFxT8EqsLuDE6FEcNbWEpw+lI=
github.com/Masterminds/sprig v2.18.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Masterminds/sprig v2.20.0+incompatible h1:dJTKKuUkYW3RMFdQFXPU/s6hg10RgctmTjRcbZ98Ap8=
github.com/Masterminds/sprig v2.20.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/aymerick/raymond v2.0.2+incompatible h1:VEp3GpgdAnv9B2GFyTvqgcKvY+mfKMjPOA3SbKLtnU0=
github.com/aymerick/raymond v2.0.2+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/bouk/monkey v1.0.0/go.mod h1:PG/63f4XEUlVyW1ttIeOJmJhhe1+t9EC/je3eTjvFhE=
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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/drone/drone-template-lib v0.0.0-20190801203641-b3f90dc7cabc h1:9OGyB12S8hsgr6zTPEGIqpyMptUXPFSA6kpt+W0BasU=
github.com/drone/drone-template-lib v0.0.0-20190801203641-b3f90dc7cabc/go.mod h1:t/pyHx6y2nrLHJFCxuMPAOq0QwC9p8jimznjjFzmbkE=
github.com/drone/drone-template-lib v1.0.0 h1:PNBBfUhifRnrPCoWBlTitk3jipXdv8u8WLbIf7h7j00=
github.com/drone/drone-template-lib v1.0.0/go.mod h1:Hqy1tgqPH5mtbFOZmow19l4jOkZvp+WZ00cB4W3MJhg=
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI=
@@ -31,5 +37,12 @@ github.com/urfave/cli v0.0.0-20180821064027-934abfb2f102 h1:Er7kUEUX12vAWCp23Uv6
github.com/urfave/cli v0.0.0-20180821064027-934abfb2f102/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+12 -1
View File
@@ -6,6 +6,7 @@ import (
"log"
"os"
"os/exec"
"runtime"
"strings"
"github.com/drone/drone-template-lib/template"
@@ -60,6 +61,14 @@ type (
}
)
func mainfestToolPath() string {
if runtime.GOOS == "windows" {
return "C:/bin/manifest-tool.exe"
}
return "/bin/manifest-tool"
}
func (p *Plugin) Exec() error {
args := []string{}
@@ -113,6 +122,8 @@ func (p *Plugin) Exec() error {
"pushing by spec",
)
} else {
args = append(args, "from-args")
if len(p.Config.Platforms) == 0 {
return errors.New("you must provide platforms")
} else {
@@ -144,7 +155,7 @@ func (p *Plugin) Exec() error {
}
cmd := exec.Command(
"manifest-tool",
mainfestToolPath(),
args...,
)