From 4341a7805b28d531dbdacf5bf4d7c5ddafcb08ca Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 11 Nov 2019 16:12:35 +0000 Subject: [PATCH 1/5] suppress the NativeCommandError as stated in https://stackoverflow.com/a/20950421 --- script/jenkins/windows-build.ps1 | 4 ++-- script/jenkins/windows-test.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/jenkins/windows-build.ps1 b/script/jenkins/windows-build.ps1 index ba0dc13275d..34efee00bf2 100644 --- a/script/jenkins/windows-build.ps1 +++ b/script/jenkins/windows-build.ps1 @@ -8,7 +8,7 @@ function Exec { try { $global:lastexitcode = 0 - & $cmd + & $cmd 2>&1 | %{ "$_" } if ($lastexitcode -ne 0) { throw $errorMessage } @@ -47,4 +47,4 @@ echo "Building fields.yml" exec { mage fields } echo "Building $env:beat" -exec { mage build } "Build FAILURE" \ No newline at end of file +exec { mage build } "Build FAILURE" diff --git a/script/jenkins/windows-test.ps1 b/script/jenkins/windows-test.ps1 index 525f143180f..98d9ad96dbb 100644 --- a/script/jenkins/windows-test.ps1 +++ b/script/jenkins/windows-test.ps1 @@ -8,7 +8,7 @@ function Exec { try { $global:lastexitcode = 0 - & $cmd + & $cmd 2>&1 | %{ "$_" } if ($lastexitcode -ne 0) { throw $errorMessage } From 77991a189deb86a5726ba802540095bde4572140 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 11 Nov 2019 16:30:09 +0000 Subject: [PATCH 2/5] force an exit error for testing purposes --- script/jenkins/windows-build.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/jenkins/windows-build.ps1 b/script/jenkins/windows-build.ps1 index 34efee00bf2..f53a6579b1d 100644 --- a/script/jenkins/windows-build.ps1 +++ b/script/jenkins/windows-build.ps1 @@ -48,3 +48,7 @@ exec { mage fields } echo "Building $env:beat" exec { mage build } "Build FAILURE" + + +echo "Force exit 1" +exit 1 From a6ef4040fb1179201b6f5658c34f864cad4713cb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 11 Nov 2019 16:34:24 +0000 Subject: [PATCH 3/5] force an exit error for testing purposes within the magefile --- magefile.go | 1 + 1 file changed, 1 insertion(+) diff --git a/magefile.go b/magefile.go index 4ea8b4040fd..1727c055e00 100644 --- a/magefile.go +++ b/magefile.go @@ -174,6 +174,7 @@ func Update() error { } func Fields() error { + panic(errors.Errorf("force error for testing purposes")) return mage.GenerateFieldsYAML("model") } From f937e916283968296bf5752f66b059bb56193d68 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 11 Nov 2019 16:52:08 +0000 Subject: [PATCH 4/5] Revert "force an exit error for testing purposes" This reverts commit 77991a189deb86a5726ba802540095bde4572140. --- script/jenkins/windows-build.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/script/jenkins/windows-build.ps1 b/script/jenkins/windows-build.ps1 index f53a6579b1d..34efee00bf2 100644 --- a/script/jenkins/windows-build.ps1 +++ b/script/jenkins/windows-build.ps1 @@ -48,7 +48,3 @@ exec { mage fields } echo "Building $env:beat" exec { mage build } "Build FAILURE" - - -echo "Force exit 1" -exit 1 From 7da84ebb6097292b30517c2518d04910d9b44a53 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 11 Nov 2019 16:52:10 +0000 Subject: [PATCH 5/5] Revert "force an exit error for testing purposes within the magefile" This reverts commit a6ef4040fb1179201b6f5658c34f864cad4713cb. --- magefile.go | 1 - 1 file changed, 1 deletion(-) diff --git a/magefile.go b/magefile.go index 1727c055e00..4ea8b4040fd 100644 --- a/magefile.go +++ b/magefile.go @@ -174,7 +174,6 @@ func Update() error { } func Fields() error { - panic(errors.Errorf("force error for testing purposes")) return mage.GenerateFieldsYAML("model") }