@@ -43,7 +43,7 @@ function RunOrExitOnFailure()
43
43
}
44
44
}
45
45
46
- function Login ([string ]$subscription , [string ]$clusterGroup , [switch ]$pushImages )
46
+ function Login ([string ]$subscription , [string ]$clusterGroup , [switch ]$skipPushImages )
47
47
{
48
48
Write-Host " Logging in to subscription, cluster and container registry"
49
49
az account show * > $null
@@ -73,7 +73,7 @@ function Login([string]$subscription, [string]$clusterGroup, [switch]$pushImages
73
73
RunOrExitOnFailure kubectl config set-context $clusterName -- namespace $defaultNamespace
74
74
}
75
75
76
- if ($pushImages ) {
76
+ if (! $skipPushImages ) {
77
77
$registry = RunOrExitOnFailure az acr list - g $clusterGroup -- subscription $subscription - o json
78
78
$registryName = ($registry | ConvertFrom-Json ).name
79
79
RunOrExitOnFailure az acr login - n $registryName
@@ -86,10 +86,10 @@ function DeployStressTests(
86
86
# Default to playground environment
87
87
[string ]$environment = ' pg' ,
88
88
[string ]$repository = ' ' ,
89
- [switch ]$pushImages ,
89
+ [switch ]$skipPushImages ,
90
90
[string ]$clusterGroup = ' ' ,
91
91
[string ]$deployId = ' ' ,
92
- [switch ]$login ,
92
+ [switch ]$skipLogin ,
93
93
[string ]$subscription = ' ' ,
94
94
[switch ]$CI ,
95
95
[string ]$Namespace ,
@@ -125,8 +125,8 @@ function DeployStressTests(
125
125
throw " clusterGroup and subscription parameters must be specified when deploying to an environment that is not pg or prod."
126
126
}
127
127
128
- if ($login ) {
129
- Login - subscription $subscription - clusterGroup $clusterGroup - pushImages: $pushImages
128
+ if (! $skipLogin ) {
129
+ Login - subscription $subscription - clusterGroup $clusterGroup - skipPushImages: $skipPushImages
130
130
}
131
131
132
132
$chartRepoName = ' stress-test-charts'
@@ -162,8 +162,8 @@ function DeployStressTests(
162
162
- deployId $deployer `
163
163
- environment $environment `
164
164
- repositoryBase $repository `
165
- - pushImages: $pushImages `
166
- - login: $login `
165
+ - skipPushImages: $skipPushImages `
166
+ - skipLogin: $skipLogin `
167
167
- clusterGroup $clusterGroup `
168
168
- subscription $subscription
169
169
}
@@ -189,8 +189,8 @@ function DeployStressPackage(
189
189
[string ]$deployId ,
190
190
[string ]$environment ,
191
191
[string ]$repositoryBase ,
192
- [switch ]$pushImages ,
193
- [switch ]$login ,
192
+ [switch ]$skipPushImages ,
193
+ [switch ]$skipLogin ,
194
194
[string ]$clusterGroup ,
195
195
[string ]$subscription
196
196
) {
@@ -267,7 +267,7 @@ function DeployStressPackage(
267
267
}
268
268
$dockerfileName = ($dockerFilePath -split { $_ -in ' \' , ' /' })[-1 ].ToLower()
269
269
$imageTag = $imageTagBase + " /${dockerfileName} :${deployId} "
270
- if ($pushImages ) {
270
+ if (! $skipPushImages ) {
271
271
Write-Host " Building and pushing stress test docker image '$imageTag '"
272
272
$dockerFile = Get-ChildItem $dockerFilePath
273
273
@@ -290,8 +290,8 @@ function DeployStressPackage(
290
290
291
291
Run docker push $imageTag
292
292
if ($LASTEXITCODE ) {
293
- if ($login ) {
294
- Write-Warning " If docker push is failing due to authentication issues, try calling this script with '-Login '"
293
+ if (! $skipLogin ) {
294
+ Write-Warning " If docker push is failing due to authentication issues, try calling this script without '-SkipLogin '"
295
295
}
296
296
}
297
297
}
0 commit comments