Add windows volumes during build

This commit is contained in:
Don
2019-01-28 13:08:30 -08:00
parent c1fe64ea72
commit baedbe59e7
2 changed files with 14 additions and 4 deletions
+10
View File
@@ -15,6 +15,9 @@ steps:
- go vet ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: C:\\gopath
- name: test
pull: always
@@ -23,6 +26,13 @@ steps:
- go test -cover ./...
environment:
GO111MODULE: on
volumes:
- name: gopath
path: C:\\gopath
volumes:
- name: gopath
temp: {}
---
kind: pipeline
+4 -4
View File
@@ -11,7 +11,7 @@ local golang_image(os, version) =
test(os='linux', arch='amd64', version='')::
local is_windows = windows(os);
local golang = golang_image(os, version);
local volumes = if !is_windows then [{name: 'gopath', path: '/go',}] else [];
local volumes = if is_windows then [{name: 'gopath', path: 'C:\\\\gopath'}] else [{name: 'gopath', path: '/go',}];
{
kind: 'pipeline',
name: test_pipeline_name,
@@ -31,7 +31,7 @@ local golang_image(os, version) =
commands: [
'go vet ./...',
],
volumes: if std.length(volumes) > 0 then volumes,
volumes: volumes,
},
{
name: 'test',
@@ -43,10 +43,10 @@ local golang_image(os, version) =
commands: [
'go test -cover ./...',
],
volumes: if std.length(volumes) > 0 then volumes,
volumes: volumes,
},
],
volumes: if !is_windows then [{name: 'gopath', temp: {}}]
volumes: [{name: 'gopath', temp: {}}]
},
build(name, os='linux', arch='amd64', version='')::