From 1fe4c54e32ad0583c2285956ace68fcced6be122 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Fri, 8 May 2020 14:21:19 -0400 Subject: [PATCH] Remove unused code --- .../networktest/New-DockerTestBuild.ps1 | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 test/docker/networktest/New-DockerTestBuild.ps1 diff --git a/test/docker/networktest/New-DockerTestBuild.ps1 b/test/docker/networktest/New-DockerTestBuild.ps1 deleted file mode 100644 index b7347bd5dc8..00000000000 --- a/test/docker/networktest/New-DockerTestBuild.ps1 +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -param ( [switch]$Force, [switch]$UseExistingMsi ) - -$script:Constants = @{ - AccountName = 'PowerShell' - ProjectName = 'powershell-f975h' - TestImageName = "remotetestimage" - MsiName = "PSCore.msi" - Token = "" # in this particular use we don't need a token -} - -############ -### MAIN ### -############ - -#### DOCKER OPS ##### -# is docker installed? -$dockerExe = Get-Command docker -ea silentlycontinue -if ( $dockerExe.name -ne "docker.exe" ) { - throw "Cannot find docker, is it installed?" -} -# Check to see if we already have an image, and if so -# delete it if -Force was used, otherwise throw and exit -$TestImage = docker images $Constants.TestImageName --format '{{.Repository}}' -if ( $TestImage -eq $Constants.TestImageName) -{ - if ( $Force ) - { - docker rmi $Constants.TestImageName - } - else - { - throw ("{0} already exists, use '-Force' to remove" -f $Constants.TestImageName) - } -} -# check again - there could be some permission problems -$TestImage = docker images $Constants.TestImageName --format '{{.Repository}}' -if ( $TestImage -eq $Constants.TestImageName) -{ - throw ("'{0}' still exists, giving up" -f $Constants.TestImageName) -} - -#### MSI CHECKS #### -# check to see if the MSI is present -$MsiExists = Test-Path $Constants.MsiName -$msg = "{0} exists, use -Force to remove or -UseExistingMsi to use" -f $Constants.MsiName -if ( $MsiExists -and ! ($force -or $useExistingMsi)) -{ - throw $msg -} - -# remove the msi -if ( $MsiExists -and $Force -and ! $UseExistingMsi ) -{ - Remove-Item -Force $Constants.MsiName - $MsiExists = $false -} - -# a couple of checks before downloading or using the existing one -# if the msi exists and -UseExistingMsi is present, we'll use the -# one we found -if ( ! $MsiExists -and $UseExistingMsi ) -{ - throw ("{0} does not exist" -f $Constants.MsiName) -} -elseif ( $MsiExists -and ! $UseExistingMsi ) -{ - throw $msg -} - -# last check before bulding the image -if ( ! (Test-Path $Constants.MsiName) ) -{ - throw ("{0} does not exist, giving up" -f $Constants.MsiName) -} - -# collect the builds and select the last one -Docker build --tag $Constants.TestImageName .