John Howard, Microsoft Corporation (@jhowardmsft). November 2016.
This repo has scripts to deploy, configure, setup development VMs, and run Docker CI on Windows Server 2016.
###Directories - Deployment scripts
- common - Common to all flavours
- rs1 - rs1 (also rs2 and rs3 as of March 2017) specifics
- config - tells production servers how to configure themselves according to the hostname
###Other directories
- runCI - The scripts to run CI, including Invoke-DockerCI. executeCI.ps1 is what is configured in Jenkins.
- Deploy-JenkinsVM - Easy way to deploy a Jenkins VM
- Install-DevVM - Setup an existing VM for development/CI VM if on Microsoft corpnet.
- Prepare-CIImage - Pick a build (on corpnet) and get a development VM (and optional) azure VHD from it.
-
Need publish settings in $env:HOME\.azure\[email protected] Get-AzurePublishSettingsFile and save to above location.
-
Make sure your azure credentials are set. (Add-AzureAccount for [email protected])
-
Run elevated
$sourceDir="\winbuilds\release\RS1_RELEASE\14393.693.161220-1747" $AzureImageVersion=0 $debugPort=50001 cd e:\docker\ci\w2w\Prepare-CIImage $AzureVMSize="" $AzurePassword="" $AzureStorageAccount="winrs1" $configSet="rs1" $vmBasePath="e:\VMs" $localPassword="something" $vmSwitch="Wired"
$sourceDir="\winbuilds\release\RS1_RELEASE\14393.693.161220-1747" $AzureImageVersion=31 $debugPort=50001 cd e:\docker\ci\w2w\Prepare-CIImage $AzureVMSize="D3" $AzurePassword="somethingelse" $AzureStorageAccount="winrs1" $configSet="rs1" $vmBasePath="e:\VMs" $localPassword="something" $vmSwitch="Wired"
###Create the development VM (and Azure image optionally) cd e:\docker\ci\w2w\Prepare-CIImage .\Prepare-CIImage.ps1 -Target $vmBasePath -Password $localPassword -CreateVM -Switch $vmSwitch -DebugPort $debugPort -Path $sourceDir -ConfigSet $configSet -AzureImageVersion $AzureImageVersion -AzurePassword $AzurePassword
###Upload VHD to Azure and create an image from it
$parts=$sourceDir.Split("");
$localLocation=(join-path
$vmIDs=@(1,2,3,4,5,6,7,8,9)
foreach ($vmID in $vmIDs) { start-job -argumentlist $vmID,$AzureVMSize,$AzureImageVersion,$configSet,$AzurePassword {
param([int]$vmID, [string]$AzureVMSize,[int]$AzureImageVersion,[string]$configSet,[string]$AzurePassword )
cd e:\docker\ci\W2W\Deploy-JenkinsVM; dir;
.\Deploy-JenkinsVM -Force -Size $AzureVMSize -ImageVersion $AzureImageVersion "jenkins-$configSet-$vmID" -Password $AzurePassword -ConfigSet n" foreach ($job in Get-Job) { Receive-Job $Job; Remove-Job $Job; Write-Host -ForegroundColor Yellow "
nn - - - - - - - -
n`n" }