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
<# | |
.SYNOPSIS | |
Uses the VSTS REST API to create pull request | |
.DESCRIPTION | |
This script uses the VSTS REST API to create a Pull Request in the specified | |
repository, source and target branches. Intended to run via VSTS Build using a build step for each repository. | |
https://www.visualstudio.com/en-us/docs/integrate/api/git/pull-requests/pull-requests | |
.NOTES |
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
#!/bin/bash | |
# Get encrypted password from MySQL Octopus variable set | |
octopus_pwd=$(get_octopusvariable "octopus_pwd") | |
# Use the directory where the package was pushed to in the previous deploy step | |
OctopusDrop=$(get_octopusvariable "Octopus.Action[Push seed script package].Output.Octopus.Action.Package.InstallationDirectoryPath") | |
echo "Drop: $OctopusDrop" | |
echo "Updating DataWarehouse DB" |
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: '' |
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
# 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
# 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
$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
<# | |
.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
$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 | |
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()] |
OlderNewer