Skip to content

Commit

Permalink
Stop running windows containers if they exist (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
brawner authored Feb 29, 2020
1 parent e72bca4 commit 434af51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions job_templates/ci_job.xml.em
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ echo Using args: !CI_ARGS!
echo "# END SECTION"

echo "# BEGIN SECTION: Run DockerFile"
rem Kill any running docker containers, which may be leftover from aborted jobs
powershell -Command "if ($(docker ps -q) -ne $null) { docker stop $(docker ps -q)}"

rem If isolated_network doesn't already exist, create it
set NETWORK_NAME=isolated_network
docker network inspect %NETWORK_NAME% 2>nul 1>nul || docker network create -d nat -o com.docker.network.bridge.enable_icc=false %NETWORK_NAME%
Expand Down
3 changes: 3 additions & 0 deletions job_templates/packaging_job.xml.em
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ echo Using args: !CI_ARGS!
echo "# END SECTION"

echo "# BEGIN SECTION: Run packaging script with DockerFile"
rem Kill any running docker containers, which may be leftover from aborted jobs
powershell -Command "if ($(docker ps -q) -ne $null) { docker stop $(docker ps -q)}"

rem If isolated_network doesn't already exist, create it
set NETWORK_NAME=isolated_network
docker network inspect %NETWORK_NAME% 2>nul 1>nul || docker network create -d nat -o com.docker.network.bridge.enable_icc=false %NETWORK_NAME%
Expand Down

0 comments on commit 434af51

Please sign in to comment.