From 470770bd18bde21204a5986c606dd1cffb4e4f46 Mon Sep 17 00:00:00 2001 From: Don Date: Fri, 25 Jan 2019 13:10:49 -0800 Subject: [PATCH] Use volumes for linux during testing --- pipeline.libsonnet | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipeline.libsonnet b/pipeline.libsonnet index 4d724f1..c6b23e8 100644 --- a/pipeline.libsonnet +++ b/pipeline.libsonnet @@ -9,7 +9,9 @@ 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',}]; { kind: 'pipeline', name: test_pipeline_name, @@ -29,6 +31,7 @@ local golang_image(os, version) = commands: [ 'go vet ./...', ], + volumes: if std.length(volumes) > 0 then volumes, }, { name: 'test', @@ -40,8 +43,10 @@ local golang_image(os, version) = commands: [ 'go test -cover ./...', ], + volumes: if std.length(volumes) > 0 then volumes, }, ], + volumes: if !is_windows then [{name: 'gopath', temp: {}}] }, build(name, os='linux', arch='amd64', version='')::