This is an example of a Concourse pipeline that performs the following tasks for a sample Golang application:
-
builds (compiles) the binary artifact
-
unit tests it
-
deploys it to a Cloud Foundry staging space
-
load tests it
-
deploys it to a Cloud Foundry production space
Each step is configured to perform automatically only if the previous step has been successfully executed.
The requirements for this pipeline's setup are as follows:
-
An instance of Concourse is installed either as a local vagrant machine or as a remote server.
Please refer to the documentation on how to install Concourse.
-
The Concourse Fly command line interface is installed on the local VM.
The Fly cli can be downloaded directly from the link provided on the Concourse web interface.
Please refer to the Fly cli documentation for details.
How to setup this sample pipeline on your Concourse server:
-
Clone this git repository on your local machine
git clone https://github.com/lsilvapvt/sample-app-pipeline.git
cd sample-app-pipeline -
Setup the pipeline credentials file
cp ci/credentials.yml.sample ci/credentials.yml
Edit ci/credentials.yml and fill out all the required credentials:
deploy-username: the userID to deploy apps on the Cloud Foundry deployment
deploy-password: the corresponding password to deploy apps on the Cloud Foundry deployment
pws-organization: the name of your organization in Cloud Foundry
pws-staging-space: the name of the staging/development space to deploy the sample app to in CF
pws-production-space: the name of the production space to deploy the sample app to in CF
pws-api: the url of the CF API. (e.g. https://api.run.pivotal.io)
-
Configure the sample pipeline in Concourse with the following commands:
fly -t local loginExample:
fly -t local login http://192.168.100.4:8080
fly -t local set-pipeline -c ci/pipeline.yml -p sample-app-pipeline -l ci/credentials.yml -
Access to the Concourse web interface (e.g. http://192.168.100.4:8080 ), click on the list of pipelines, un-pause the sample-app-pipeline and then click on its link to visualize its pipeline diagram.
You will then notice the pipeline's jobs getting executed within a few seconds, one at a time, if the previous job in the pipeline is executed successfully.
Notice that the pipeline is organized in two groups: delivery and deployment, with corresponding links located at the top of the pipeline's diagram.
The delivery group contains the jobs associated with a typical build and test pipeline for development organizations and/or a staging environment. See the pipeline image above.
The deployment group displays the job associated with the typical task of promoting a successful build from development/staging into production.
Edit file ci/pipeline.yml to inspect how this sample Concourse pipeline was defined and structured.
This project was forked from the original work of J.Calabrese's sample concourse app.