From d67fbd42de0ffa4af46bcd04ff3423cc4d37ec30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Thu, 9 May 2024 22:46:38 +0000 Subject: [PATCH 01/28] disabled delete vm --- CI/Azure-DevOps/AZ_MainPipeline.yml | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 64e6e0f5d..c5108c002 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -22,22 +22,22 @@ parameters: # TODO, these don't work for scheduled pipelines, not even the defau default: # - name: SQL2012 # SQLVersionEdition: 2012Ent - - name: SQL2014 - SQLVersionEdition: 2014 + # - name: SQL2014 + # SQLVersionEdition: 2014 - name: SQL2016 SQLVersionEdition: 2016 - - name: SQL2017 - SQLVersionEdition: 2017 - - name: SQL2019 - SQLVersionEdition: 2019 - - name: SQL2022 - SQLVersionEdition: 2022 - - name: SQL2017Linux - SQLVersionEdition: 2017L - - name: SQL2019Linux - SQLVersionEdition: 2019L - - name: SQL2022Linux - SQLVersionEdition: 2022L + # - name: SQL2017 + # SQLVersionEdition: 2017 + # - name: SQL2019 + # SQLVersionEdition: 2019 + # - name: SQL2022 + # SQLVersionEdition: 2022 + # - name: SQL2017Linux + # SQLVersionEdition: 2017L + # - name: SQL2019Linux + # SQLVersionEdition: 2019L + # - name: SQL2022Linux + # SQLVersionEdition: 2022L - name: VMPriority displayName: VM Priority type: string @@ -805,7 +805,7 @@ stages: dependsOn: - Create_Environments - Validate - condition: always() + condition: false #always() pool: vmImage: 'windows-latest' From f805f25ca0a55f75b98b87b8d4060f9aa7cbc3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 01:33:12 +0000 Subject: [PATCH 02/28] added parameter to Create Environment Only --- CI/Azure-DevOps/AZ_MainPipeline.yml | 37 ++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index c5108c002..1da0a0067 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -46,6 +46,10 @@ parameters: # TODO, these don't work for scheduled pipelines, not even the defau - Spot - Regular - Low + - name: CreateEnvOnly + displayName: Create Environment Only + default: false + type: boolean variables: - name: ArtifactBranchName @@ -249,6 +253,34 @@ stages: $DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$(CreateSQLVMEnvironment.FQDNAndPort)" -Username "$(CreateSQLVMEnvironment.SQLUserName)" -Password "$(CreateSQLVMEnvironment.SQLPwd)" -As DataSet -TrustServerCertificate $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } + - job: PrintConnectionInfo + dependsOn: Create_Environments + condition: eq(${{ parameters.envonly }}, true) + strategy: + matrix: + ${{ each version in parameters.VMMatrix }}: + ${{ format('{0}', version.name) }}: + SQLVersionEdition: ${{ version.SQLVersionEdition }} + SQLVersionName: ${{ version.name }} + steps: + - task: PowerShell@2 + name: PrintConnectionInfo + inputs: + targetType: 'inline' + script: | + $SQLUserNameKey = "$(System.JobName).CreateSQLVMEnvironment.SQLUserName"; + $SQLPwdKey = "$(System.JobName).CreateSQLVMEnvironment.SQLPwd"; + $FQDNAndPortKey = "$(System.JobName).CreateSQLVMEnvironment.FQDNAndPort"; + $SQLUserName = $myJsonObject.$SQLUserNameKey; + $SQLPwd = (ConvertTo-SecureString $myJsonObject.$SQLPwdKey -AsPlainText); + $FQDNAndPort = $myJsonObject.$FQDNAndPortKey; + Log-Output '=========================================================='; + Log-Output "Name: $(SQLVersionName)"; + Log-Output "FQDN: $FQDNAndPort"; + Log-Output "User: $SQLUserName"; + Log-Output "FQDN: $SQLPwd"; + Log-Output '=========================================================='; + ########################################################################################################## ## BUILD tSQLt - PART 1 ## @@ -263,6 +295,7 @@ stages: - job: CompileCLR timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 + condition: eq(${{ parameters.envonly }}, false) # variables: # CertificatePath: '$(Build.Repository.LocalPath)/tsqltclr/OfficialSigningKey/tSQLtOfficialSigningKey.pfx' @@ -805,7 +838,9 @@ stages: dependsOn: - Create_Environments - Validate - condition: false #always() + + condition: not(and(eq(${{ parameters.envonly }}, true), eq(stageDependencies.Create_Environments.Create.result, 'Succeeded'))) + pool: vmImage: 'windows-latest' From 038793aaa26b5655ea0268b5c89e2a0866c76257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 01:35:24 +0000 Subject: [PATCH 03/28] fixed typo --- CI/Azure-DevOps/AZ_MainPipeline.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 1da0a0067..8767d6ccb 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -38,6 +38,10 @@ parameters: # TODO, these don't work for scheduled pipelines, not even the defau # SQLVersionEdition: 2019L # - name: SQL2022Linux # SQLVersionEdition: 2022L + - name: CreateEnvOnly + displayName: Create Environment Only + default: false + type: boolean - name: VMPriority displayName: VM Priority type: string @@ -46,10 +50,6 @@ parameters: # TODO, these don't work for scheduled pipelines, not even the defau - Spot - Regular - Low - - name: CreateEnvOnly - displayName: Create Environment Only - default: false - type: boolean variables: - name: ArtifactBranchName @@ -255,7 +255,7 @@ stages: - job: PrintConnectionInfo dependsOn: Create_Environments - condition: eq(${{ parameters.envonly }}, true) + condition: eq(${{ parameters.CreateEnvOnly }}, true) strategy: matrix: ${{ each version in parameters.VMMatrix }}: @@ -295,7 +295,7 @@ stages: - job: CompileCLR timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 - condition: eq(${{ parameters.envonly }}, false) + condition: eq(${{ parameters.CreateEnvOnly }}, false) # variables: # CertificatePath: '$(Build.Repository.LocalPath)/tsqltclr/OfficialSigningKey/tSQLtOfficialSigningKey.pfx' @@ -839,7 +839,7 @@ stages: - Create_Environments - Validate - condition: not(and(eq(${{ parameters.envonly }}, true), eq(stageDependencies.Create_Environments.Create.result, 'Succeeded'))) + condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), eq(stageDependencies.Create_Environments.Create.result, 'Succeeded'))) pool: vmImage: 'windows-latest' From 46be2ad39700ac6528be204a49534aadfa74b06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 01:36:39 +0000 Subject: [PATCH 04/28] more typos --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 8767d6ccb..896408b49 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -254,7 +254,7 @@ stages: $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } - job: PrintConnectionInfo - dependsOn: Create_Environments + dependsOn: Create condition: eq(${{ parameters.CreateEnvOnly }}, true) strategy: matrix: From 490fc84a1ca1cb998939b13f7aab59bd26e779cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 01:45:28 +0000 Subject: [PATCH 05/28] ..... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 896408b49..054c3598e 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -263,6 +263,7 @@ stages: SQLVersionEdition: ${{ version.SQLVersionEdition }} SQLVersionName: ${{ version.name }} steps: + - checkout: none - task: PowerShell@2 name: PrintConnectionInfo inputs: @@ -274,12 +275,12 @@ stages: $SQLUserName = $myJsonObject.$SQLUserNameKey; $SQLPwd = (ConvertTo-SecureString $myJsonObject.$SQLPwdKey -AsPlainText); $FQDNAndPort = $myJsonObject.$FQDNAndPortKey; - Log-Output '=========================================================='; - Log-Output "Name: $(SQLVersionName)"; - Log-Output "FQDN: $FQDNAndPort"; - Log-Output "User: $SQLUserName"; - Log-Output "FQDN: $SQLPwd"; - Log-Output '=========================================================='; + Write-Info '=========================================================='; + Write-Warning "Name: $(SQLVersionName)"; + Write-Warning "FQDN: $FQDNAndPort"; + Write-Warning "User: $SQLUserName"; + Write-Warning "FQDN: $SQLPwd"; + Write-Host '=========================================================='; ########################################################################################################## @@ -289,13 +290,13 @@ stages: - stage: Build_tSQLt_Part1 dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel + condition: eq(${{ parameters.CreateEnvOnly }}, false) jobs: - job: CompileCLR timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 - condition: eq(${{ parameters.CreateEnvOnly }}, false) # variables: # CertificatePath: '$(Build.Repository.LocalPath)/tsqltclr/OfficialSigningKey/tSQLtOfficialSigningKey.pfx' From 91dcdb39c38083e2585bb78d5193476bb82776ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 01:50:24 +0000 Subject: [PATCH 06/28] ...... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 054c3598e..c107e9239 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -255,7 +255,7 @@ stages: - job: PrintConnectionInfo dependsOn: Create - condition: eq(${{ parameters.CreateEnvOnly }}, true) + condition: and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded('Create')) strategy: matrix: ${{ each version in parameters.VMMatrix }}: From d603e65e0c47d82f3e87bd64df292dcb5cb1ab35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 02:02:13 +0000 Subject: [PATCH 07/28] ........ --- CI/Azure-DevOps/AZ_MainPipeline.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index c107e9239..8b2ee22ac 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -262,6 +262,8 @@ stages: ${{ format('{0}', version.name) }}: SQLVersionEdition: ${{ version.SQLVersionEdition }} SQLVersionName: ${{ version.name }} + variables: + databaseAccessDetails: $[convertToJson(Create.outputs)] steps: - checkout: none - task: PowerShell@2 @@ -269,11 +271,15 @@ stages: inputs: targetType: 'inline' script: | + $inputObject = @' + $(databaseAccessDetails) + '@; + $myJsonObject = ConvertFrom-JSON -InputObject $inputObject; $SQLUserNameKey = "$(System.JobName).CreateSQLVMEnvironment.SQLUserName"; $SQLPwdKey = "$(System.JobName).CreateSQLVMEnvironment.SQLPwd"; $FQDNAndPortKey = "$(System.JobName).CreateSQLVMEnvironment.FQDNAndPort"; $SQLUserName = $myJsonObject.$SQLUserNameKey; - $SQLPwd = (ConvertTo-SecureString $myJsonObject.$SQLPwdKey -AsPlainText); + $SQLPwd = $myJsonObject.$SQLPwdKey; $FQDNAndPort = $myJsonObject.$FQDNAndPortKey; Write-Info '=========================================================='; Write-Warning "Name: $(SQLVersionName)"; @@ -281,6 +287,12 @@ stages: Write-Warning "User: $SQLUserName"; Write-Warning "FQDN: $SQLPwd"; Write-Host '=========================================================='; + - task: PowerShell@2 + name: fail + inputs: + targetType: 'inline' + script: | + 1/0 ########################################################################################################## From 59f0813ce0e494ca8305d3ecd588df7b0494155f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 02:25:14 +0000 Subject: [PATCH 08/28] ........ --- CI/Azure-DevOps/AZ_MainPipeline.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 8b2ee22ac..628531546 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -287,12 +287,6 @@ stages: Write-Warning "User: $SQLUserName"; Write-Warning "FQDN: $SQLPwd"; Write-Host '=========================================================='; - - task: PowerShell@2 - name: fail - inputs: - targetType: 'inline' - script: | - 1/0 ########################################################################################################## @@ -852,7 +846,7 @@ stages: - Create_Environments - Validate - condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), eq(stageDependencies.Create_Environments.Create.result, 'Succeeded'))) + condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), eq(stageDependencies.Create_Environments.PrintConnectionInfo.result, 'Succeeded'))) pool: vmImage: 'windows-latest' From 1b18dee316a71f69c51c130befe42190c088ccfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sat, 11 May 2024 02:29:27 +0000 Subject: [PATCH 09/28] .......... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 628531546..e357bae78 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -263,7 +263,7 @@ stages: SQLVersionEdition: ${{ version.SQLVersionEdition }} SQLVersionName: ${{ version.name }} variables: - databaseAccessDetails: $[convertToJson(Create.outputs)] + databaseAccessDetails: $[convertToJson(dependencies.Create.outputs)] steps: - checkout: none - task: PowerShell@2 From e62dafcc49c2c639210952481fc255f029ced9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 18:14:23 +0000 Subject: [PATCH 10/28] .......... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index e357bae78..8ef52b09d 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -281,12 +281,12 @@ stages: $SQLUserName = $myJsonObject.$SQLUserNameKey; $SQLPwd = $myJsonObject.$SQLPwdKey; $FQDNAndPort = $myJsonObject.$FQDNAndPortKey; - Write-Info '=========================================================='; + Write-Host '==========================================================' -ForegroundColor Yellow; Write-Warning "Name: $(SQLVersionName)"; Write-Warning "FQDN: $FQDNAndPort"; Write-Warning "User: $SQLUserName"; Write-Warning "FQDN: $SQLPwd"; - Write-Host '=========================================================='; + Write-Host '==========================================================' -ForegroundColor Yellow; ########################################################################################################## From 290a3636e487e7e5a08d8d1780f60f4ba3bdd59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 18:29:32 +0000 Subject: [PATCH 11/28] do we eed an addition job? --- CI/Azure-DevOps/AZ_MainPipeline.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 8ef52b09d..840f445bd 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -241,6 +241,16 @@ stages: # Write-Host "##vso[task.setvariable variable=SerializedVMDetails;isOutput=true]$SerializedVMDetails"; + if eq(${{ parameters.CreateEnvOnly }}, true){ + Write-Host '==========================================================' -ForegroundColor Yellow; + Write-Warning "Name: $(SQLVersionName)"; + Write-Warning "RGNm: $ResourceGroupName"; + Write-Warning "FQDN: $FQDNAndPort"; + Write-Warning "User: $SQLUserName"; + Write-Warning "Pass: $SQLPwd"; + Write-Host '==========================================================' -ForegroundColor Yellow; + } + - task: PowerShell@2 name: PrintSQLVersionInfo @@ -285,7 +295,7 @@ stages: Write-Warning "Name: $(SQLVersionName)"; Write-Warning "FQDN: $FQDNAndPort"; Write-Warning "User: $SQLUserName"; - Write-Warning "FQDN: $SQLPwd"; + Write-Warning "Pass: $SQLPwd"; Write-Host '==========================================================' -ForegroundColor Yellow; From bdd3d316b0031e45ad1338d88bd4ae11152db2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 18:33:18 +0000 Subject: [PATCH 12/28] ..... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 840f445bd..b9717e221 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -241,7 +241,7 @@ stages: # Write-Host "##vso[task.setvariable variable=SerializedVMDetails;isOutput=true]$SerializedVMDetails"; - if eq(${{ parameters.CreateEnvOnly }}, true){ + if(eq(${{ parameters.CreateEnvOnly }}, true)){ Write-Host '==========================================================' -ForegroundColor Yellow; Write-Warning "Name: $(SQLVersionName)"; Write-Warning "RGNm: $ResourceGroupName"; From 85210cd44410f61b30daaed63d9a8d0928f6ccc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 18:37:15 +0000 Subject: [PATCH 13/28] ...... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index b9717e221..add3224fc 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -241,7 +241,7 @@ stages: # Write-Host "##vso[task.setvariable variable=SerializedVMDetails;isOutput=true]$SerializedVMDetails"; - if(eq(${{ parameters.CreateEnvOnly }}, true)){ + if(eq("${{ parameters.CreateEnvOnly }}", "True")){ Write-Host '==========================================================' -ForegroundColor Yellow; Write-Warning "Name: $(SQLVersionName)"; Write-Warning "RGNm: $ResourceGroupName"; From 524fe641ff23e58511e9ff3bd4a50457ec7a76ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 18:44:36 +0000 Subject: [PATCH 14/28] ...... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index add3224fc..72271e4c2 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -241,7 +241,7 @@ stages: # Write-Host "##vso[task.setvariable variable=SerializedVMDetails;isOutput=true]$SerializedVMDetails"; - if(eq("${{ parameters.CreateEnvOnly }}", "True")){ + if("${{ parameters.CreateEnvOnly }}" -ieq "true"){ Write-Host '==========================================================' -ForegroundColor Yellow; Write-Warning "Name: $(SQLVersionName)"; Write-Warning "RGNm: $ResourceGroupName"; From de15c4a31863a2160ea67d924d05f21246a32c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 19:20:31 +0000 Subject: [PATCH 15/28] ....... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 72271e4c2..113860e80 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -241,16 +241,6 @@ stages: # Write-Host "##vso[task.setvariable variable=SerializedVMDetails;isOutput=true]$SerializedVMDetails"; - if("${{ parameters.CreateEnvOnly }}" -ieq "true"){ - Write-Host '==========================================================' -ForegroundColor Yellow; - Write-Warning "Name: $(SQLVersionName)"; - Write-Warning "RGNm: $ResourceGroupName"; - Write-Warning "FQDN: $FQDNAndPort"; - Write-Warning "User: $SQLUserName"; - Write-Warning "Pass: $SQLPwd"; - Write-Host '==========================================================' -ForegroundColor Yellow; - } - - task: PowerShell@2 name: PrintSQLVersionInfo @@ -263,6 +253,16 @@ stages: $DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$(CreateSQLVMEnvironment.FQDNAndPort)" -Username "$(CreateSQLVMEnvironment.SQLUserName)" -Password "$(CreateSQLVMEnvironment.SQLPwd)" -As DataSet -TrustServerCertificate $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } + if("${{ parameters.CreateEnvOnly }}" -ieq "true"){ + Write-Host '==========================================================' -ForegroundColor Yellow; + Write-Warning "Name: $(SQLVersionName)"; + Write-Warning "RGNm: $(CreateSQLVMEnvironment.ResourceGroupName)"; + Write-Warning "FQDN: $(CreateSQLVMEnvironment.FQDNAndPort)"; + Write-Warning "User: $(CreateSQLVMEnvironment.SQLUserName)"; + Write-Warning "Pass: $(CreateSQLVMEnvironment.SQLPwd)"; + Write-Host '==========================================================' -ForegroundColor Yellow; + } + - job: PrintConnectionInfo dependsOn: Create condition: and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded('Create')) From 7a3633a7ec7b277ee92cf405a55e5eff467b5320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 19:34:18 +0000 Subject: [PATCH 16/28] ........ --- CI/Azure-DevOps/AZ_MainPipeline.yml | 42 +++++++++-------------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 113860e80..fbae3fd1c 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -225,14 +225,12 @@ stages: # $SerializedVMDetails; #-----------------------------------------------------------------------# - # IMPORTANT (and, you've got to be kidding me): # - # The space below is absolutely required to make the ANT Task work. # + # The space below is required to make ANT work. (Not currently in use.) # #---------------------------------------|-------------------------------# $FQDNAndPort = $VMDetails.SQLVmFQDN + ", " + $VMDetails.SQLVmPort; #---------------------------------------|-------------------------------# #-----------------------------------------------------------------------# - #TODO refactor such that the resourcegroupname is created in a previous step, so that it can be used by the delete job, even if this one is cancelled/failed. $ResourceGroupName = $VMDetails.ResourceGroupName; Write-Host "##vso[task.setvariable variable=SQLUserName;isOutput=true]$SQLUserName" Write-Host "##vso[task.setvariable variable=SQLPwd;isOutput=true]$SQLPwd" @@ -242,27 +240,6 @@ stages: # Write-Host "##vso[task.setvariable variable=SerializedVMDetails;isOutput=true]$SerializedVMDetails"; - - task: PowerShell@2 - name: PrintSQLVersionInfo - env: - USER_NAME: $(tSQLt-UserForCIEnvironment-UserName) - PASSWORD: $(tSQLt-UserForCIEnvironment-Password) - inputs: - targetType: 'inline' - script: | - $DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$(CreateSQLVMEnvironment.FQDNAndPort)" -Username "$(CreateSQLVMEnvironment.SQLUserName)" -Password "$(CreateSQLVMEnvironment.SQLPwd)" -As DataSet -TrustServerCertificate - $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } - - if("${{ parameters.CreateEnvOnly }}" -ieq "true"){ - Write-Host '==========================================================' -ForegroundColor Yellow; - Write-Warning "Name: $(SQLVersionName)"; - Write-Warning "RGNm: $(CreateSQLVMEnvironment.ResourceGroupName)"; - Write-Warning "FQDN: $(CreateSQLVMEnvironment.FQDNAndPort)"; - Write-Warning "User: $(CreateSQLVMEnvironment.SQLUserName)"; - Write-Warning "Pass: $(CreateSQLVMEnvironment.SQLPwd)"; - Write-Host '==========================================================' -ForegroundColor Yellow; - } - - job: PrintConnectionInfo dependsOn: Create condition: and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded('Create')) @@ -291,12 +268,17 @@ stages: $SQLUserName = $myJsonObject.$SQLUserNameKey; $SQLPwd = $myJsonObject.$SQLPwdKey; $FQDNAndPort = $myJsonObject.$FQDNAndPortKey; - Write-Host '==========================================================' -ForegroundColor Yellow; - Write-Warning "Name: $(SQLVersionName)"; - Write-Warning "FQDN: $FQDNAndPort"; - Write-Warning "User: $SQLUserName"; - Write-Warning "Pass: $SQLPwd"; - Write-Host '==========================================================' -ForegroundColor Yellow; + + $DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$FQDNAndPort" -Username "$SQLUserName" -Password "$SQLPwd" -As DataSet -TrustServerCertificate + $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } + if("${{ parameters.CreateEnvOnly }}" -ieq "true"){ + Write-Host '==========================================================' -ForegroundColor Yellow; + Write-Warning "Name: $(SQLVersionName)"; + Write-Warning "FQDN: $FQDNAndPort"; + Write-Warning "User: $SQLUserName"; + Write-Warning "Pass: $SQLPwd"; + Write-Host '==========================================================' -ForegroundColor Yellow; + } ########################################################################################################## From 72a496abe3e93988ba31cf98164d9f09e7b36d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 19:53:08 +0000 Subject: [PATCH 17/28] ........ --- CI/Azure-DevOps/AZ_MainPipeline.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index fbae3fd1c..a79fc2405 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -273,11 +273,20 @@ stages: $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } if("${{ parameters.CreateEnvOnly }}" -ieq "true"){ Write-Host '==========================================================' -ForegroundColor Yellow; - Write-Warning "Name: $(SQLVersionName)"; - Write-Warning "FQDN: $FQDNAndPort"; - Write-Warning "User: $SQLUserName"; - Write-Warning "Pass: $SQLPwd"; + Write-Host "Name: $(SQLVersionName)"; + Write-Host "FQDN: $FQDNAndPort"; + Write-Host "User: $SQLUserName"; + Write-Host "Pass: $SQLPwd"; Write-Host '==========================================================' -ForegroundColor Yellow; + + Write-Warning 'This information is now public! Run the following statement to change the password immediately!' -ForegroundColor Yellow; + + $Command = '$NewPwd = -join ((33..126) * 3 | Get-Random -Count 12 | % {[char]$_}); Write-Output "New Password: $NewPwd"; Invoke-Sqlcmd -Query "ALTER LOGIN [$($myJsonObject.$SQLUserNameKey)] WITH PASSWORD = ''$NewPwd'' REUSE;" -ServerInstance $myJsonObject.$FQDNAndPortKey -Username $myJsonObject.$SQLUserNameKey -Password $myJsonObject.$SQLPwdKey' + $EscapedCommand = $Command -replace '"', '""' + Write-Host '==========================================================' -ForegroundColor Yellow; + Write-Host $EscapedCommand + Write-Host '==========================================================' -ForegroundColor Yellow; + } From 65a32a88c40d1fb259551e187f697a350dfb3dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 19:53:58 +0000 Subject: [PATCH 18/28] ........ --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index a79fc2405..630eb15f8 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -279,7 +279,7 @@ stages: Write-Host "Pass: $SQLPwd"; Write-Host '==========================================================' -ForegroundColor Yellow; - Write-Warning 'This information is now public! Run the following statement to change the password immediately!' -ForegroundColor Yellow; + Write-Warning 'This information is now public! Run the following Powershell Statement to change the password immediately!' -ForegroundColor Yellow; $Command = '$NewPwd = -join ((33..126) * 3 | Get-Random -Count 12 | % {[char]$_}); Write-Output "New Password: $NewPwd"; Invoke-Sqlcmd -Query "ALTER LOGIN [$($myJsonObject.$SQLUserNameKey)] WITH PASSWORD = ''$NewPwd'' REUSE;" -ServerInstance $myJsonObject.$FQDNAndPortKey -Username $myJsonObject.$SQLUserNameKey -Password $myJsonObject.$SQLPwdKey' $EscapedCommand = $Command -replace '"', '""' From 87488df65410163b953567da71be3a99e36f8f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 19:56:37 +0000 Subject: [PATCH 19/28] took condition out and renamed PrintSQLInfo --- CI/Azure-DevOps/AZ_MainPipeline.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 630eb15f8..004987ad0 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -240,9 +240,8 @@ stages: # Write-Host "##vso[task.setvariable variable=SerializedVMDetails;isOutput=true]$SerializedVMDetails"; - - job: PrintConnectionInfo + - job: PrintSQLInfo dependsOn: Create - condition: and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded('Create')) strategy: matrix: ${{ each version in parameters.VMMatrix }}: @@ -254,7 +253,7 @@ stages: steps: - checkout: none - task: PowerShell@2 - name: PrintConnectionInfo + name: PrintSQLInfo inputs: targetType: 'inline' script: | @@ -271,6 +270,7 @@ stages: $DS = Invoke-Sqlcmd -Query "SELECT SUSER_NAME() U,SYSDATETIME() T,@@VERSION V;" -ServerInstance "$FQDNAndPort" -Username "$SQLUserName" -Password "$SQLPwd" -As DataSet -TrustServerCertificate $DS.Tables[0].Rows | %{ echo "{ $($_['U']), $($_['T']), $($_['V']) }" } + if("${{ parameters.CreateEnvOnly }}" -ieq "true"){ Write-Host '==========================================================' -ForegroundColor Yellow; Write-Host "Name: $(SQLVersionName)"; @@ -847,7 +847,7 @@ stages: - Create_Environments - Validate - condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), eq(stageDependencies.Create_Environments.PrintConnectionInfo.result, 'Succeeded'))) + condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), eq(stageDependencies.Create_Environments.PrintSQLInfo.result, 'Succeeded'))) pool: vmImage: 'windows-latest' From 618df71a265427fc5bcbb40cb7c3fe4b6252a87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 20:00:08 +0000 Subject: [PATCH 20/28] ...... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 004987ad0..b5a21ea1c 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -279,7 +279,7 @@ stages: Write-Host "Pass: $SQLPwd"; Write-Host '==========================================================' -ForegroundColor Yellow; - Write-Warning 'This information is now public! Run the following Powershell Statement to change the password immediately!' -ForegroundColor Yellow; + Write-Warning 'This information is now public! Run the following Powershell Statement to change the password immediately!'; $Command = '$NewPwd = -join ((33..126) * 3 | Get-Random -Count 12 | % {[char]$_}); Write-Output "New Password: $NewPwd"; Invoke-Sqlcmd -Query "ALTER LOGIN [$($myJsonObject.$SQLUserNameKey)] WITH PASSWORD = ''$NewPwd'' REUSE;" -ServerInstance $myJsonObject.$FQDNAndPortKey -Username $myJsonObject.$SQLUserNameKey -Password $myJsonObject.$SQLPwdKey' $EscapedCommand = $Command -replace '"', '""' From 5d0f197797e4356cb34420ed511c6a358bd80a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 23:21:55 +0000 Subject: [PATCH 21/28] ...... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index b5a21ea1c..fd87ab6dc 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -281,10 +281,9 @@ stages: Write-Warning 'This information is now public! Run the following Powershell Statement to change the password immediately!'; - $Command = '$NewPwd = -join ((33..126) * 3 | Get-Random -Count 12 | % {[char]$_}); Write-Output "New Password: $NewPwd"; Invoke-Sqlcmd -Query "ALTER LOGIN [$($myJsonObject.$SQLUserNameKey)] WITH PASSWORD = ''$NewPwd'' REUSE;" -ServerInstance $myJsonObject.$FQDNAndPortKey -Username $myJsonObject.$SQLUserNameKey -Password $myJsonObject.$SQLPwdKey' - $EscapedCommand = $Command -replace '"', '""' - Write-Host '==========================================================' -ForegroundColor Yellow; - Write-Host $EscapedCommand + $PwdChngCommand = "`$NewPwd = -join ((33..126) * 3 | Get-Random - Count 12 | % {[char]`$_}); Write-Output `"New Password: `$NewPwd`"; Invoke-Sqlcmd -Query `"ALTER LOGIN [abc] WITH PASSWORD = '`$NewPwd';`" -ServerInstance `"$FQDNAndPort`" -Username `"$SQLUserName`" -Password `"$SQLPwd`";"; + Write-Host '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' -ForegroundColor Yellow; + Write-Host $PwdChngCommand Write-Host '==========================================================' -ForegroundColor Yellow; } @@ -847,7 +846,7 @@ stages: - Create_Environments - Validate - condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), eq(stageDependencies.Create_Environments.PrintSQLInfo.result, 'Succeeded'))) + condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded('Create_Environments.PrintSQLInfo'))) pool: vmImage: 'windows-latest' From 85baf742c44c21d7066ba44f6b0b1fd7a3caa5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Sun, 12 May 2024 23:58:01 +0000 Subject: [PATCH 22/28] fixed password generation --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index fd87ab6dc..d4510c24c 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -281,7 +281,7 @@ stages: Write-Warning 'This information is now public! Run the following Powershell Statement to change the password immediately!'; - $PwdChngCommand = "`$NewPwd = -join ((33..126) * 3 | Get-Random - Count 12 | % {[char]`$_}); Write-Output `"New Password: `$NewPwd`"; Invoke-Sqlcmd -Query `"ALTER LOGIN [abc] WITH PASSWORD = '`$NewPwd';`" -ServerInstance `"$FQDNAndPort`" -Username `"$SQLUserName`" -Password `"$SQLPwd`";"; + $PwdChngCommand = "`$NewPwd = -join ((40..95+97..126) | Get-Random -Count 30 | % {[char]`$_}); Write-Output `"New Password: `$NewPwd`"; Invoke-Sqlcmd -Query `"ALTER LOGIN [abc] WITH PASSWORD = '`$NewPwd';`" -ServerInstance `"$FQDNAndPort`" -Username `"$SQLUserName`" -Password `"$SQLPwd`" -TrustServerCertificate;"; Write-Host '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' -ForegroundColor Yellow; Write-Host $PwdChngCommand Write-Host '==========================================================' -ForegroundColor Yellow; From c571a5b134aebfb04bb94b6719e355b1e988d21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Mon, 13 May 2024 00:13:09 +0000 Subject: [PATCH 23/28] debugging --- CI/Azure-DevOps/AZ_MainPipeline.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index d4510c24c..01212d2e0 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -852,6 +852,19 @@ stages: vmImage: 'windows-latest' jobs: + - job: DebugInfo + variables: + - name: CreateEnvOnly + value: ${{ parameters.CreateEnvOnly }} + - name: PrintSQLInfoStat + value: "${{ dependencies.Create_Environments.PrintSQLInfo.result }}" + - name: PrintSQLInfoSuc + value: succeeded('Create_Environments.PrintSQLInfo') + steps: + - script: | + echo "CreateEnvOnly: $(CreateEnvOnly)" + echo "PrintSQLInfoSuc: $(PrintSQLInfoSuc)" + echo "PrintSQLInfoStat: $(PrintSQLInfoStat)" - job: Delete_VM From 00fc4e325ac04da17e2e74874f55634a85cecadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Mon, 13 May 2024 00:16:02 +0000 Subject: [PATCH 24/28] ..... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 01212d2e0..d1a3ed405 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -853,18 +853,21 @@ stages: jobs: - job: DebugInfo - variables: - - name: CreateEnvOnly - value: ${{ parameters.CreateEnvOnly }} - - name: PrintSQLInfoStat - value: "${{ dependencies.Create_Environments.PrintSQLInfo.result }}" - - name: PrintSQLInfoSuc - value: succeeded('Create_Environments.PrintSQLInfo') + dependsOn: + - Create_Environments steps: - - script: | - echo "CreateEnvOnly: $(CreateEnvOnly)" - echo "PrintSQLInfoSuc: $(PrintSQLInfoSuc)" - echo "PrintSQLInfoStat: $(PrintSQLInfoStat)" + - pwsh: | + # Access the parameter directly + Write-Host "CreateEnvOnly: ${{ parameters.CreateEnvOnly }}" + + # Access the outcome of a job from another stage, assuming `Create_Environments` is a stage and `PrintSQLInfo` is a job within that stage. + $printSQLInfoStatus = '$(stageDependencies.Create_Environments.PrintSQLInfo.result)' + Write-Host "PrintSQLInfo Status: $printSQLInfoStatus" + + # Determine if the specific job succeeded + $printSQLInfoSucceeded = '$[eq(variables[''stageDependencies.Create_Environments.PrintSQLInfo.result''], ''Succeeded'')]' + Write-Host "PrintSQLInfo Succeeded: $printSQLInfoSucceeded" + - job: Delete_VM From 534e0e26253ab8435a46473f7052af43cc1c397a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Mon, 13 May 2024 00:16:49 +0000 Subject: [PATCH 25/28] ..... --- CI/Azure-DevOps/AZ_MainPipeline.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index d1a3ed405..25bc3e843 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -853,8 +853,6 @@ stages: jobs: - job: DebugInfo - dependsOn: - - Create_Environments steps: - pwsh: | # Access the parameter directly From 7d72f983b407f04cb7d271b0651daea5b1034216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Mon, 13 May 2024 00:41:34 +0000 Subject: [PATCH 26/28] moved the condition to the delete job --- CI/Azure-DevOps/AZ_MainPipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 25bc3e843..5b29a323c 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -281,7 +281,7 @@ stages: Write-Warning 'This information is now public! Run the following Powershell Statement to change the password immediately!'; - $PwdChngCommand = "`$NewPwd = -join ((40..95+97..126) | Get-Random -Count 30 | % {[char]`$_}); Write-Output `"New Password: `$NewPwd`"; Invoke-Sqlcmd -Query `"ALTER LOGIN [abc] WITH PASSWORD = '`$NewPwd';`" -ServerInstance `"$FQDNAndPort`" -Username `"$SQLUserName`" -Password `"$SQLPwd`" -TrustServerCertificate;"; + $PwdChngCommand = "`$NewPwd = -join ((40..95+97..126) | Get-Random -Count 30 | % {[char]`$_}); Write-Output `"New Password: `$NewPwd`"; Invoke-Sqlcmd -Query `"ALTER LOGIN [$SQLUserName] WITH PASSWORD = '`$NewPwd';`" -ServerInstance `"$FQDNAndPort`" -Username `"$SQLUserName`" -Password `"$SQLPwd`" -TrustServerCertificate;"; Write-Host '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' -ForegroundColor Yellow; Write-Host $PwdChngCommand Write-Host '==========================================================' -ForegroundColor Yellow; @@ -846,8 +846,6 @@ stages: - Create_Environments - Validate - condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded('Create_Environments.PrintSQLInfo'))) - pool: vmImage: 'windows-latest' @@ -875,6 +873,8 @@ stages: ${{ format('{0}', version.name) }}: SQLVersionEdition: ${{ version.SQLVersionEdition }} + condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded(format('Create_Environments.PrintSQLInfo_{0}', version.name)))) + variables: databaseAccessDetails: $[convertToJson(stageDependencies.Create_Environments.Create.outputs)] From 802203283f5860811e0b2a3ce93e1791ef159dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Mon, 13 May 2024 00:45:25 +0000 Subject: [PATCH 27/28] simplified condition broken VMs will now not get cleaned up --- CI/Azure-DevOps/AZ_MainPipeline.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 5b29a323c..6d808c264 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -846,25 +846,12 @@ stages: - Create_Environments - Validate + condition: not(eq(${{ parameters.CreateEnvOnly }}, true)) + pool: vmImage: 'windows-latest' jobs: - - job: DebugInfo - steps: - - pwsh: | - # Access the parameter directly - Write-Host "CreateEnvOnly: ${{ parameters.CreateEnvOnly }}" - - # Access the outcome of a job from another stage, assuming `Create_Environments` is a stage and `PrintSQLInfo` is a job within that stage. - $printSQLInfoStatus = '$(stageDependencies.Create_Environments.PrintSQLInfo.result)' - Write-Host "PrintSQLInfo Status: $printSQLInfoStatus" - - # Determine if the specific job succeeded - $printSQLInfoSucceeded = '$[eq(variables[''stageDependencies.Create_Environments.PrintSQLInfo.result''], ''Succeeded'')]' - Write-Host "PrintSQLInfo Succeeded: $printSQLInfoSucceeded" - - - job: Delete_VM strategy: @@ -872,8 +859,6 @@ stages: ${{ each version in parameters.VMMatrix }}: ${{ format('{0}', version.name) }}: SQLVersionEdition: ${{ version.SQLVersionEdition }} - - condition: not(and(eq(${{ parameters.CreateEnvOnly }}, true), succeeded(format('Create_Environments.PrintSQLInfo_{0}', version.name)))) variables: databaseAccessDetails: $[convertToJson(stageDependencies.Create_Environments.Create.outputs)] From 7212e8927f418293c40b75580a05f26bb2a890cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmbt1=E2=80=9D?= Date: Mon, 13 May 2024 01:21:25 +0000 Subject: [PATCH 28/28] increased new password length, removed selection of windows agent from dacpac step --- CI/Azure-DevOps/AZ_MainPipeline.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CI/Azure-DevOps/AZ_MainPipeline.yml b/CI/Azure-DevOps/AZ_MainPipeline.yml index 6d808c264..9863f621b 100644 --- a/CI/Azure-DevOps/AZ_MainPipeline.yml +++ b/CI/Azure-DevOps/AZ_MainPipeline.yml @@ -281,7 +281,7 @@ stages: Write-Warning 'This information is now public! Run the following Powershell Statement to change the password immediately!'; - $PwdChngCommand = "`$NewPwd = -join ((40..95+97..126) | Get-Random -Count 30 | % {[char]`$_}); Write-Output `"New Password: `$NewPwd`"; Invoke-Sqlcmd -Query `"ALTER LOGIN [$SQLUserName] WITH PASSWORD = '`$NewPwd';`" -ServerInstance `"$FQDNAndPort`" -Username `"$SQLUserName`" -Password `"$SQLPwd`" -TrustServerCertificate;"; + $PwdChngCommand = "`$NewPwd = -join ((40..95+97..126) | Get-Random -Count 40 | % {[char]`$_}); Write-Output `"New Password: `$NewPwd`"; Invoke-Sqlcmd -Query `"ALTER LOGIN [$SQLUserName] WITH PASSWORD = '`$NewPwd';`" -ServerInstance `"$FQDNAndPort`" -Username `"$SQLUserName`" -Password `"$SQLPwd`" -TrustServerCertificate;"; Write-Host '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' -ForegroundColor Yellow; Write-Host $PwdChngCommand Write-Host '==========================================================' -ForegroundColor Yellow; @@ -435,9 +435,6 @@ stages: ${{ format('{0}', version.name) }}: SQLVersionEdition: ${{ version.SQLVersionEdition }} - pool: - vmImage: 'windows-latest' - variables: databaseAccessDetails: $[convertToJson(stageDependencies.Create_Environments.Create.outputs)]