Skip to content
David Dieruf edited this page Jan 29, 2020 · 3 revisions

Getting Started in concourse

Each pipeline job is run on a pre-built image distributed from the cf-community docker hub. Have a look at the Dockerfile to see what packages are baked in. Outside of what can be preinstalled in the image, there are a few assets the pipeline needs at run time...

  1. A current Windows image. Testing was done with Windows Server 2019 but you could also use Server 1709 or Server 1803. Windows ISO images are not distributable. You will need to manually add it to the vSphere datastore. Note within the store, the pipeline is expecting the ISO to be within a datastore folder named Win-Stemcell-ISO. For testing you can download the trial Windows Server 2019 ISO.

  2. Govc executable, see the docs for more detail. The build image uses the latest stable 0.21 release.

  3. The Local Group Policy Object(LGPO) Utility. See the docs for more detail. The pipeline is set to download the latest release.

  4. Stembuild executable, see the docs for more detail. The pipeleline is set to download the latest stable release from GitHub. It's going to get a compatible version to the ISO operating system version (1709, 1803, 2019). There is also an option to download the same asset from the Pivotal network (PivNet).

Docker

Building a new base image for Concourse jobs or running bats tests:

docker build -t windows-stemcell-concourse .

Helps & Docs

There is a helper powershell file named commands.ps1. This has example scripts for setting up an S3 bucket in AWS (using their powershell commands), example concourse command to set the pipeline, and an example script to retrieve VCenter certificate.

A walk around the project

├── assets - The needed assets for running the tasks
│   ├── autounattend.xml - The template xml to automate windows installation
│   └── unattend.xml - The template xml to automate windows account creation
├── tasks - Holds all the main scripts and helper functions
│   ├── functions - Hold helper scripts used through out the tasks
│   │   ├── autounattend.sh - For parsing the autounattend xml template and replacing placeholders with values supplied
│   │   ├── govc.sh - Interpreting functions made available by the vsphere api with supplied values
│   │   ├── .xml - Templates to be used into the templates :)
│   │   └── utility.sh - Odd global functions for formatting
│   ├── clone-base.sh - Take the resulting VM of the `create-base` task and clone it, to be used for a specfic stembuild version
│   ├── clone-base.yml - The concourse definition of the task
│   ├── construct.sh - Take the resulting VM of the `clone-base` task, run stembuild to harden it for Cloud Foundry, and sysprep it
│   ├── construct.yml - The concourse definition of the task
│   ├── create-base.sh - The initial task to be run that takes a Windows ISO image, installs as a VM, runs Windows updates, and loads other tools
│   ├── create-base.yml - The concourse definition of the task
│   ├── package.sh - Take the sysprepped (shut down) VM of the `construct` task, download the image, and convert to a stemcell format
│   ├── package.yml - The concourse definition of the task
│   ├── update-base.sh - Power on the base VM and run windows update on it a few times, then power off
│   └── update-base.yml - The concourse definition of the task
├── tests - For running the tasks locally
│   ├── stemcell - Holds the final stemcell file
│   ├── concourse.sh - Run the concourse tasks, without creating the pipeline using the `fly execute` command
│   ├── functions.sh - Mimic what all the tasks do, calling the appropriate function in `/tasks/functions`
│   └── tasks.sh - Mimic what all the tasks do, calling the appropriate .sh script in `/tasks`
└── pipeline.yml - The concourse pipeline definition
└── vars-min.yml - A template for providing the minimum required values to the concourse pipeline
Clone this wiki locally