This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Description | |
Script used to bulk update Azure Pipeline release definition's WindowsMachineFileCopy from v1 to v2 | |
.Example | |
.\Update-ReleaseDefinitionsWindowsMachineFileCopyTask.ps1 -PAT "NoTaReAlPaT" -AzureDevOpsProjectURL "https://vsrm.dev.azure.com/{organization}/{project}" | |
#> | |
[CmdletBinding()] | |
Param |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build app using Azure Pipelines | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript?view=vsts | |
pool: | |
vmImage: 'vs2017-win2016' | |
steps: | |
– script: echo hello world | |
– task: NodeTool@0 | |
inputs: | |
versionSpec: '8.x' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Description | |
Script used to gather all releases that have been successfully deployed to QA, | |
but not yet promoted to Prod environments. Outputs release definition name and URL of release to LatestReleases.html | |
.Example | |
.\Get-ReleasesNotInProduction.ps1 -PAT "NoTaReAlPaT" -AzureDevOpsProjectURL "https://vsrm.dev.azure.com/{organization}/{project}" | |
#> | |
[CmdletBinding()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dotnet = Get-Process dotnet -ErrorAction SilentlyContinue | |
If($dotnet){ | |
taskkill.exe /F /IM dotnet.exe | |
} | |
Else{ | |
"No dotnet.exe tasks to kill" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
Creates a new release for the specified release definition name, using the latest artifact versions available | |
.Parameter PAT | |
Personal Access token. It's recommended to use a service account and pass via encrypted build definition variable. | |
https://docs.microsoft.com/en-us/vsts/organizations/accounts/use-personal-access-tokens-to-authenticate?view=vsts | |
.Parameter ReleaseDefinitionName | |
Name of release definition to create a release for | |
.Notes | |
-Parameters are outside of functions in order to be passed by TFS build definition variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$VersionRegex = "\d+\.\d+\.\d+\.\d+" | |
$Files = Get-ChildItem $Env:BUILD_SOURCESDIRECTORY -recurse -include "*Properties*" | | |
?{ $_.PSIsContainer } | | |
ForEach { Get-ChildItem -Path $_.FullName -Recurse -include AssemblyInfo.* } | |
If($Files){ | |
"Will apply $env:Version to $($Files.count) files." | |
ForEach ($File in $Files) { | |
$Filecontent = Get-Content($File) | |
attrib $File -r | |
$Filecontent -replace $VersionRegex, $env:Version | Out-File $File |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Array of agents to create | |
example_agents = ['Example-1', "Example-2", "Example-3", "Example-4", "Example-5", "Example-6"] | |
example_agentpool = '' | |
install_dir = 'H:\\agents\\' | |
sv_user = '' # Windows log on account for agent service | |
sv_password = '' | |
vsts_url = 'https://youraccount.visualstudio.com' | |
vsts_token = '' # Temporary PAT to use when installing the agents | |
# Download install files from S3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Part 2 of 2 | |
# Part 1 Places EC2 instance into autoscaling group's standby mode. | |
# Part 2 Exits standby mode and waits for instance to be InService. | |
param ( | |
[Parameter(Mandatory=$true)][string]$ASGEnterStandbyDeployStep, # Deploy step name of EnterStandby.ps1 | |
[Parameter(Mandatory=$true)][string]$ASGNameVariable, # Variable name that is set by EnterStandby.ps1 for ASG Name | |
[Parameter(Mandatory=$true)][string]$registrationCheckInterval, | |
[Parameter(Mandatory=$true)][string]$maxRegistrationCheckCount | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Part 1 of 2 | |
# Part 1 Places EC2 instance into autoscaling group's standby mode. | |
# Part 2 Exits standby mode and waits for instance to be InService. | |
param ( | |
[Parameter(Mandatory=$true)][string]$ASGNameVariable # Passed in Octopus script step | |
) | |
# Get EC2 Instance | |
Try | |
{ | |
$response = Invoke-RestMethod -Uri "http://169.254.169.254/latest/meta-data/instance-id" -Method Get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phases: | |
- phase: CD | |
queue: LEP | |
steps: | |
- task: PowerShell@1 | |
displayName: ExtConfigs_PreBuild.ps1 | |
inputs: | |
scriptType: filePath | |
scriptName: "$(repo.BuildScripts)/ExtConfigs_PreBuild.ps1" | |
arguments: '' |