From ace846991e38c1360349f991648ee1200c658f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=BChnel?= Date: Thu, 2 Apr 2020 08:42:08 +0200 Subject: [PATCH] added testing option this does not start the agent --- scripts/windows_agent_start.ps1 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/windows_agent_start.ps1 b/scripts/windows_agent_start.ps1 index 35a7520..bce8315 100644 --- a/scripts/windows_agent_start.ps1 +++ b/scripts/windows_agent_start.ps1 @@ -20,7 +20,8 @@ param( [Parameter(Mandatory=$true)] [ValidateSet("buildkite", "jenkins")] - [string]$master + [string]$master, + [switch]$testing = $false ) $NAME="agent-windows-${master}" @@ -37,10 +38,20 @@ docker stop ${NAME} docker rm ${NAME} Write-Output "Starting container..." -docker run -d ` +if (${testing}) { + docker run -it ` -v D:\:C:\ws ` -v C:\credentials:C:\credentials ` -e PARENT_HOSTNAME=$env:computername ` --restart unless-stopped ` --name ${NAME} ` - ${IMAGE} \ No newline at end of file + ${IMAGE} powershell +} else { + docker run -d ` + -v D:\:C:\ws ` + -v C:\credentials:C:\credentials ` + -e PARENT_HOSTNAME=$env:computername ` + --restart unless-stopped ` + --name ${NAME} ` + ${IMAGE} +}