mirror of
https://github.com/drone-plugins/drone-manifest.git
synced 2026-06-04 10:15:14 +08:00
Update windows build
This commit is contained in:
+16
-16
@@ -10,7 +10,7 @@ platform:
|
||||
steps:
|
||||
- name: vet
|
||||
pull: always
|
||||
image: golang:1.11-windowsservercore-1803
|
||||
image: golang:1.12-windowsservercore-1803
|
||||
commands:
|
||||
- go vet ./...
|
||||
environment:
|
||||
@@ -21,7 +21,7 @@ steps:
|
||||
|
||||
- name: test
|
||||
pull: always
|
||||
image: golang:1.11-windowsservercore-1803
|
||||
image: golang:1.12-windowsservercore-1803
|
||||
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:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# escape=`
|
||||
FROM plugins/base:windows-1803
|
||||
FROM plugins/base:windows-1803-amd64
|
||||
|
||||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
|
||||
org.label-schema.name="Drone Manifest" `
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# escape=`
|
||||
FROM plugins/base:windows-1809
|
||||
FROM plugins/base:windows-1809-amd64
|
||||
|
||||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
|
||||
org.label-schema.name="Drone Manifest" `
|
||||
|
||||
@@ -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 build.tag "v"}}-{{/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 build.tag "v"}}-{{/if}}windows-1809-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: windows
|
||||
|
||||
@@ -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{}
|
||||
|
||||
@@ -144,7 +153,7 @@ func (p *Plugin) Exec() error {
|
||||
}
|
||||
|
||||
cmd := exec.Command(
|
||||
"manifest-tool",
|
||||
mainfestToolPath(),
|
||||
args...,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user