GithubHelp home page GithubHelp logo

kolyshkin / docker-w2wciscripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stefanschneider/docker-w2wciscripts

0.0 3.0 0.0 333.69 MB

License: MIT License

PowerShell 99.46% Shell 0.36% Batchfile 0.18%

docker-w2wciscripts's Introduction

About

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
  • rs - Redstone specifics (rs1, rs2, rs3 as of June 2017)
  • 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.

How to use.

Pre-reqs

  • 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

Sample variables for development VM only

$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="rs" $redstoneRelease=0 $vmBasePath="e:\VMs" $localPassword="something" $vmSwitch="Wired"

Sample variables for production RS1 VHD (and development VM)

$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="0" $redstoneRelease=1 $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 -RedstoneRelease $redstoneRelease

###Upload VHD to Azure and create an image from it $parts=$sourceDir.Split(""); $localLocation=(join-path $vmBasePath -ChildPath ("$($parts[4]) $($parts[5])")); $localVHD=(join-Path $localLocation -ChildPath "azure$($configSet)$($redstoneRelease)v$AzureImageVersion.vhd") $AzureMediaLocation="https://$AzureStorageAccount.blob.core.windows.net/vhds/azure$($configSet)$($redstoneRelease)v$($AzureImageVersion).vhd" Add-Azurevhd $AzureMediaLocation -LocalFilePath $localVHD Add-AzureVMImage -imagename "azure$($ConfigSet)$($redstoneRelease)v$($AzureImageVersion)" -MediaLocation $AzureMediaLocation -OS Windows

Deploy to production

$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 $ConfigSet -RedstoneRelease $redstoneRelease } | Out-Null }; Write-Host -nonewline "Deploying $($vmIDs.Count) production VMs in parallel:" while (Get-Job -State "Running") { Write-Host -nonewline "."; Start-Sleep -Seconds 5 }; Write-Host "n" foreach ($job in Get-Job) { Receive-Job $Job; Remove-Job $Job; Write-Host -ForegroundColor Yellow "nn - - - - - - - -n`n" }

docker-w2wciscripts's People

Contributors

johnstep avatar jterry75 avatar mattkur avatar psftw avatar

Watchers

James Cloos avatar Kir Kolyshkin avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.