Skip to content

johnstep/jhowardmsft-docker-w2wCIScripts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

John Howard, Microsoft Corporation (@jhowardmsft). November 2016.

This repo has (almost) everything to deploy, configure, run Docker CI on Windows Server 2016. As of May 2016, it includes support for TP5 pre-4D ZDP, TP5 with 5B, and RS1 builds (experimental, more work to do).

###Directories - Deployment scripts

  • common - Common to all flavours (TP5, RS1 etc)
  • tp5 - Exclusive to TP5
  • tp5pre4d - Exclusive to TP5 Pre-4D builds (now retired)
  • rs1 - Exclusive to RS1 builds leading to 2016 RTM.

###Other directories

  • runCI - The scripts to run CI, including Invoke-DockerCI
  • Deploy-JenkinsVM - Easy way to deploy a Jenkins VM
  • Install-DevVM - Setup a development/CI VM if on Microsoft corpnet. (Hard coded bits for jhoward)

How to use.

Install packer and pre-reqs

Create a VHD.

I prepare my own. Here's an example.

  • Create a generation 1 VM in Hyper-V and use a VHD, not a VHDX. Size 127GB

  • Install from media (datacentre, with GUI)

    Allow Enhanced Session Mode (optional)

    set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0

    Copy base images to c:\baseimages as windowsservercore.wim and nanoserver.wim

    c:\windows\system32\sysprep\sysprep /oobe /generalize /shutdown

    Copy the VHD to AzureTP5vX.vhd where X is used in the next part for upload.

(TP5) Then upload it to Azure and deploy a Jenkins VM.

Note this will require some username/password/subscription IDs. This is for TP5

# BUMP THE VERSION EACH TIME!!!
$version=54  # packer.ps1 picks this up too.
$env:BranchType="tp5"
$env:version=$version
$env:storageaccount="tp5"
$env:JENKINS_PASSWORD_W2W="SECRET"
$env:AZURE_SUBSCRIPTION_ID="SECRET"
$env:AZURE_SUBSCRIPTION_USERNAME="SECRET"
$env:AZURE_SUBSCRIPTION_PASSWORD="SECRET"


$userName = $env:AZURE_SUBSCRIPTION_USERNAME
$securePassword = ConvertTo-SecureString -String $env:AZURE_SUBSCRIPTION_PASSWORD -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($userName, $securePassword)
Add-AzureAccount -Credential $cred 

# Upload the VHD
Add-Azurevhd "https://tp5.blob.core.windows.net/vhds/azuretp5v$version.vhd" -LocalFilePath ".\azuretp5v$version.vhd"

# Add image to your list of custom images
Add-AzureVMImage -imagename "azuretp5v$version" -MediaLocation "https://tp5.blob.core.windows.net/vhds/azuretp5v$version.vhd" -OS Windows

z:
cd \docker\ci\W2W\common
.\packer.ps1 $env:version

# Deploy VM - this will pick up the last image by timestamp uploaded, which starts 'azuretp5v'
cd ..\Deploy-JenkinsVM
.\Deploy-JenkinsVM -StorageAccount "tp5" -Force -Size "D3" -ImagePrefix "jenkins-tp5" "jenkins-tp5-99" -Password "$env:JENKINS_PASSWORD_W2W" -AzureSubscriptionID "$env:AZURE_SUBSCRIPTION_ID"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 98.8%
  • Other 1.2%