Skip to content

Commit

Permalink
Update pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvand committed May 2, 2019
1 parent 5629878 commit c7228c8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 87 deletions.
75 changes: 10 additions & 65 deletions DevOps-ApplyDTLArtifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ resources:

variables:
BuildConfiguration: Release
ConfigureServerFolderName: Configure server

jobs:
- job: ApplyArtifactsSP2013
Expand All @@ -16,38 +15,20 @@ jobs:
vmImage: 'windows-2019'
steps:
- checkout: none #skip checking out the default repository resource
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download apply-dtl-artifact.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.psm1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.psm1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: AzurePowerShell@3
displayName: 'Apply artifact "Azure Pipelines Agent"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: '-DevTestLabName "$(DevTestLabs.LabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Yvand/AzureRM-Templates" -ArtifactName "windows-vsts-build-agent" -param_vstsAccount "$(DevOps.OrganizationName)" -param_vstsPassword "$(DevOps.AccessToken)" -param_poolName "$(system.teamProject)-Tests-$(jobSharePointVersion)" -param_windowsLogonAccount "$(Deployment.DomainName)\$(Deployment.AdminUserName)" -param_windowsLogonPassword "$(Deployment.AdminPassword)" -param_agentName "SP$(jobSharePointVersion)" -param_agentNameSuffix "-$(Build.BuildNumber)" -param_RunAsAutoLogon false -param_driveLetter C -param_workDirectory ""'
preferredAzurePowerShellVersion: 5.1.1

- task: AzurePowerShell@3
displayName: 'Apply artifact "Download Azure Pipelines Artifact and Run Script"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop\$(ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
preferredAzurePowerShellVersion: 5.1.1

- job: ApplyArtifactsSP2016
Expand All @@ -60,38 +41,20 @@ jobs:
vmImage: 'windows-2019'
steps:
- checkout: none #skip checking out the default repository resource
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download apply-dtl-artifact.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.psm1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.psm1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: AzurePowerShell@3
displayName: 'Apply artifact "Azure Pipelines Agent"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: '-DevTestLabName "$(DevTestLabs.LabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Yvand/AzureRM-Templates" -ArtifactName "windows-vsts-build-agent" -param_vstsAccount "$(DevOps.OrganizationName)" -param_vstsPassword "$(DevOps.AccessToken)" -param_poolName "$(system.teamProject)-Tests-$(jobSharePointVersion)" -param_windowsLogonAccount "$(Deployment.DomainName)\$(Deployment.AdminUserName)" -param_windowsLogonPassword "$(Deployment.AdminPassword)" -param_agentName "SP$(jobSharePointVersion)" -param_agentNameSuffix "-$(Build.BuildNumber)" -param_RunAsAutoLogon false -param_driveLetter C -param_workDirectory ""'
preferredAzurePowerShellVersion: 5.1.1

- task: AzurePowerShell@3
displayName: 'Apply artifact "Download Azure Pipelines Artifact and Run Script"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop\$(ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
preferredAzurePowerShellVersion: 5.1.1

- job: ApplyArtifactsSP2019
Expand All @@ -103,37 +66,19 @@ jobs:
pool:
vmImage: 'windows-2019'
steps:
- checkout: none #skip checking out the default repository resource
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download apply-dtl-artifact.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.psm1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.psm1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)'

- checkout: none #skip checking out the default repository resource
- task: AzurePowerShell@3
displayName: 'Apply artifact "Azure Pipelines Agent"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: '-DevTestLabName "$(DevTestLabs.LabName)" -VirtualMachineName "SP$(jobSharePointVersion)" -RepositoryName "Yvand/AzureRM-Templates" -ArtifactName "windows-vsts-build-agent" -param_vstsAccount "$(DevOps.OrganizationName)" -param_vstsPassword "$(DevOps.AccessToken)" -param_poolName "$(system.teamProject)-Tests-$(jobSharePointVersion)" -param_windowsLogonAccount "$(Deployment.DomainName)\$(Deployment.AdminUserName)" -param_windowsLogonPassword "$(Deployment.AdminPassword)" -param_agentName "SP$(jobSharePointVersion)" -param_agentNameSuffix "-$(Build.BuildNumber)" -param_RunAsAutoLogon false -param_driveLetter C -param_workDirectory ""'
preferredAzurePowerShellVersion: 5.1.1

- task: AzurePowerShell@3
displayName: 'Apply artifact "Download Azure Pipelines Artifact and Run Script"'
inputs:
azureSubscription: '$(DevTestLabs.AzureConnectionName)'
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop\$(ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
ScriptPath: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)\apply-dtl-artifact.ps1'
ScriptArguments: -DevTestLabName '$(DevTestLabs.LabName)' -VirtualMachineName 'SP$(jobSharePointVersion)' -RepositoryName 'Yvand/AzureRM-Templates' -ArtifactName 'windows-vsts-download-and-run-script' -param_vstsProjectUri 'https://dev.azure.com/$(DevOps.OrganizationName)/$(system.teamProject)' -param_buildDefinitionName '$(DevOps.BuildArtifactsPipelineName)' -param_personalAccessToken $(DevOps.AccessToken) -param_pathToScript 'drop\$(Deployment.ConfigureServerFolderName)\ConfigureLab.ps1' -param_scriptArguments "-pathToPackage ''..\$(system.teamProject)\bin\$(BuildConfiguration)\$(system.teamProject).wsp' -claimsProviderName '$(system.teamProject)' -spTrustName '$(Deployment.DomainFQDN)' -adminUserName '$(Deployment.DomainName)\$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)'"
preferredAzurePowerShellVersion: 5.1.1
30 changes: 23 additions & 7 deletions DevOps-Compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ resources:

variables:
SolutionFileName: '$(system.teamProject).sln'
IntegrationTestsDataFolderName: 'Integration tests data'
ConfigureServerFolderName: Configure server

jobs:
- job: Compile
Expand Down Expand Up @@ -35,12 +33,12 @@ jobs:
# Set variables
$azureStorageBaseDirectory = "Resources\$(system.teamProject)"
$projectLocalPath = "$(System.DefaultWorkingDirectory)\$(system.teamProject)"
$devTestLabsLocalPath = "$(Build.ArtifactStagingDirectory)\$(IntegrationTestsDataFolderName)"
$devTestLabsLocalPath = "$(Build.ArtifactStagingDirectory)\$(Tests.DataFolderName)"
# Create now folder that will contain later scripts to configure local test server
if ((Test-Path -Path "$(ConfigureServerFolderName)" -PathType Container) -eq $false) {
New-Item -ItemType Directory -Path "$(ConfigureServerFolderName)"
}
#if ((Test-Path -Path "$(Build.ArtifactStagingDirectory)\$(Deployment.ConfigureServerFolderName)" -PathType Container) -eq $false) {
#New-Item -ItemType Directory -Path "$(Build.ArtifactStagingDirectory)\$(Deployment.ConfigureServerFolderName)"
#}
Write-Output ("Copy signing key from $(DownloadSecureFile.secureFilePath) to $projectLocalPath")
Copy-Item "$(DownloadSecureFile.secureFilePath)" -Destination "$projectLocalPath"
Expand All @@ -59,11 +57,29 @@ jobs:
if ((Test-Path -Path $devTestLabsLocalPath -PathType Container) -eq $false) {
New-Item -ItemType Directory -Path $devTestLabsLocalPath
}
$azurePath = Join-Path -Path $azureStorageBaseDirectory -ChildPath "$(IntegrationTestsDataFolderName)"
$azurePath = Join-Path -Path $azureStorageBaseDirectory -ChildPath "$(Tests.DataFolderName)"
Get-AzureStorageFile -ShareName $(AzureStorageShareName) -Context $azureContext -Path $azurePath | Get-AzureStorageFile | ?{$_.GetType().Name -eq "CloudFile"} | Get-AzureStorageFileContent -Destination $devTestLabsLocalPath
displayName: 'Import resources'
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download apply-dtl-artifact.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/apply-dtl-artifact.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)'
- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.ps1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.ps1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)'

- task: automagically.DownloadFile.DownloadFile.DownloadFile@1
displayName: 'Download ConfigureLab.psm1'
inputs:
FileUrl: 'https://raw.githubusercontent.com/Yvand/AzureRM-Templates/dev/DevTestLabs-Artifacts/manage-artifacts/ConfigureLab.psm1'
DestinationFolder: '$(System.DefaultWorkingDirectory)\drop\$(Deployment.ConfigureServerFolderName)'

- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.4.1'
inputs:
Expand Down
4 changes: 2 additions & 2 deletions DevOps-CreateDTLEnvironment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
ConnectedServiceName: '$(DevTestLabs.AzureConnectionName)'
LabId: '/subscriptions/$(DevTestLabs.AzureSubscriptionId)/resourceGroups/$(DevTestLabs.LabName)/providers/Microsoft.DevTestLab/labs/$(DevTestLabs.LabName)'
RepositoryId: '/subscriptions/$(DevTestLabs.AzureSubscriptionId)/resourcegroups/$(DevTestLabs.LabName)/providers/microsoft.devtestlab/labs/$(DevTestLabs.LabName)/artifactsources/$(DevTestLabs.RepoID)'
TemplateId: '/subscriptions/$(DevTestLabs.AzureSubscriptionId)/resourceGroups/$(DevTestLabs.LabName)/providers/Microsoft.DevTestLab/labs/$(DevTestLabs.LabName)/artifactSources/$(DevTestLabs.RepoID)/armTemplates/SharePoint-ADFS-DevTestLabs'
TemplateId: '/subscriptions/$(DevTestLabs.AzureSubscriptionId)/resourceGroups/$(DevTestLabs.LabName)/providers/Microsoft.DevTestLab/labs/$(DevTestLabs.LabName)/artifactSources/$(DevTestLabs.RepoID)/armTemplates/$(DevTestLabs.ARMTemplateName)'
EnvironmentName: 'Tests-$(system.teamProject)'
ParameterOverrides: "-location '$(Deployment.Location)' -provisionSharePoint2013 '$(Deployment.ProvisionSharePoint2013)' -provisionSharePoint2016 '$(Deployment.ProvisionSharePoint2016)' -provisionSharePoint2019 '$(Deployment.ProvisionSharePoint2019)' -enableHybridBenefitServerLicenses 'Yes' -adminUserName '$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)' -serviceAccountsPassword '$(Deployment.ServiceAccountsPassword)'"
ParameterOverrides: "-provisionSharePoint2013 '$(Deployment.ProvisionSharePoint2013)' -provisionSharePoint2016 '$(Deployment.ProvisionSharePoint2016)' -provisionSharePoint2019 '$(Deployment.ProvisionSharePoint2019)' -enableHybridBenefitServerLicenses 'Yes' -adminUserName '$(Deployment.AdminUserName)' -adminPassword '$(Deployment.AdminPassword)' -serviceAccountsPassword '$(Deployment.ServiceAccountsPassword)' -createPublicIPAndDNS '$(Deployment.CreatePublicIPAndDNS)'"
TemplateOutputVariables: true
ExportEnvironmentTemplate: true
timeoutInMinutes: 90
Loading

0 comments on commit c7228c8

Please sign in to comment.