© Copyright 2017 Pivotal Software, Inc. All rights Reserved. Version 1.0
October 25 2017
CI and CD Using
Concourse For PCF
Cover w/ Image
Agenda
■  Introduction to CI & CD
■  Concourse Overview
■  Why Containers and Pipelines are
Useful
■  Concourse in practice
■  How to get started using Concourse for
CI/CD
■  Q & A
Introduction to CI & CD
CONCOURSE FOR PCF
What is CI &
CD ?
Continuous Integration is the practice of merging
your changes back into the main branch as often as
possible. Changes are continuously checked against
a suite of automated tests to ensure that the
application isn’t broken as a result of the changes
Continuous Delivery is the practice of building,
testing and releasing software into production
environments faster, and more frequently
What Problems
Do CI & CD
solve?
Continuous Integration:
●  The application should always be in a working state
●  All software is broken until you prove it works
●  Write tests to capture the business requirements,
acceptance requirements, and expected functionality
Continuous Delivery:
●  Code is only valuable and useful when it is in the
hands of the customer
●  Bugs happen. Business requirements change. Push
to production as often as possible, as quickly as
possible
Concourse Overview
CONCOURSE FOR PCF
Concourse's user interface helps
you find out what you need to
know about your builds as quickly
as possible.
Streamlined
UI
Rather than a myriad of
checkboxes, pipelines are defined
as a single declarative config file,
composing together just three core
concepts.
As your project grows, your
pipeline will grow with it, and
remain understandable.
Simple and
Scalable
Pipelines are defined as a single
declarative config file composing
together just three core concepts.
Resources
●  Track versions of
external artifacts used for
CI / CD
●  Any entity that can be
checked for new versions,
pulled down at a specific
version, and/or pushed to
●  Can by one of many types
of built in resources; git
repositories, Amazon S3
Buckets, Docker Images,
or a custon
implementation
Three Core Concepts
Tasks
●  Allow the execution of
arbitrary scripts against a
set of resources.
●  Can output directories
representing a new
resource version.
●  Run in a container using a
configurable container
image.
Jobs
●  Represent the plan for a
build step within a
pipeline.
●  Can contain operations
against resources, or
tasks as steps.
●  Builds of a job’s plan can
be triggered manually or
trigger on new versions of
resource.
jobs:	
-	name:	run-unit-tests	
		plan:	
		-	get:	source-code	
		-	task:	run-tests	
				file:	source-code/unit.yml	
resources:	
-	name:	source-code	
		type:	git	
		source:	
					uri:	((repo_uri))	
	
	
	
-	name:	release	
		type:	cf	
		source:	
			...	
	
	
	
	
	
	
	
		-	put:	release
As your project grows, your
pipeline will grow with it, and
remain understandable.
resources:	
...	
	
jobs:	
-	name:	run-unit-tests	
		plan:	
		-	get:	source-code	
		-	task:	run-tests	
				file:	source-code/unit.yml	
	
-	name:	deploy-to-staging	
		plan:	
		-	get:	source-code	
				passed:	[run-unit-tests]	
		-	put:	release
Why Containers Are Useful
CONCOURSE FOR PCF
Containers are a form of virtualization using Linux
features which allow the creation of effectively a
separate Linux machine running on a host.
Concourse creates containers on Workers which run
the same containerization APIs used by Cloud
Foundry.
Containerization is accomplished using Linux
features (chroot jails, namespaces, mounts) to isolate
a process, and create a new directory system, which
can be based off of a container image from Docker
Hub or other registry. This allows Concourse users to
use public, OSS container images for whichever
programming language their software is using, or
build their own.
What are
Containers ?
Concourse controls the inputs to
your pipeline so that the results are
repeatable every time.
Rather than sharing state, every
task runs in its own container,
controlling its own dependencies.
Dependable
Results
Rather than sharing state, every
task runs in its own container,
controlling its own dependencies.
Dependability
Through
Containerization
> test.sh
git@my/repo.git@d4e5f6
Why Pipelines Are Useful
CONCOURSE FOR PCF
Developing CI and CD pipelines in Concourse allows
users to efficiently and resiliently test and ship
software.
Since resources are the connective tissue between
jobs, test and release pipelines can be separated into
smaller units, or connected as one large pipeline.
Using the passed semantics for resources, pipeline
developers can perfom fan-out and fan-in style logic
to parallelize their testing. Fan-in logic can be used to
ensure only a tested set of microservices reach a
deployment job.
Why Pipelines
are Useful
a1b2c3
d4e5f6
d4e5f6
Concourse In Practice
CONCOURSE FOR PCF
Concourse’s simple core concepts ammount to a CI/
CD system which allows immense flexibility for users.
The use of containerization to isolate and virtualize
the environment for testing allows for flexibility while
retaining reliability.
Concourse does not need to support - or even have
an opinion on - specific programming languages, build
systems, or deployment automation, or cloud lifecycle
management tools. If it can run in a container, you
can put it in your pipeline.
Concourse in
Practice
Concourse is purpose-built for
Microservices CI and CD
---	
platform:	linux	
	
image_resource:	
		type:	docker-image	
		source:	
				repository:	ruby	
				tag:	'2.1'	
	
inputs:	
-	name:	😼-source-code	
	
run:	
		path:	my-app/scripts/test
---	
platform:	linux	
	
image_resource:	
		type:	docker-image	
		source:	
				repository:	ruby	
				tag:	'2.1'	
	
inputs:	
-	name:	😼-source-code	
	
run:	
		path:	my-app/scripts/test
The git	resource can pull and push to
git repositories.
The hg	resource can pull and push to
Mercurial repositories.
The s3	resource can fetch from and
upload to S3 buckets.
The github-release	resource can
fetch and publish versioned GitHub
resources.
The docker-image	resource can fetch,
build, and push Docker images
The cf	resource can deploy an
application to Cloud Foundry.
The bosh-deployment	resource can
deploy BOSH stemcells and releases.
How to Get Started Using
Concourse
CONCOURSE FOR PCF
https://ci.concourse.ci
https://concourse.ci/tutorials.html
Q & A
CONCOURSE FOR PCF
Transforming How The World Builds Software
© Copyright 2017 Pivotal Software, Inc. All rights Reserved.

Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse