In this chapter, we assume that you deploy your application to Cloud Foundry PaaS.
There following projects take part in the
microservice setup for this demo.
If you want only to run the demo as far as possible by using PCF Dev and Docker Compose, do the following:
Four applications compose the pipeline
You need to fork only the following repositories, because only then can you tag and push the tag to the repository:
You can run Concourse + Artifactory locally. To do so, run the
start.sh script from this repository. The following listing shows the script:
git clone https://github.com/spring-cloud/spring-cloud-pipelines cd spring-cloud-pipelines/concourse ./setup_docker_compose.sh ./start.sh 192.168.99.100
setup_docker_compose.sh script should be run only once, to allow
generation of keys.
192.168.99.100 param is an example of an external URL of Concourse
(equal to the Docker-Machine IP in this example).
Then Concourse runs on port
8080, and Artifactory runs on
When Artifactory is running, run the
tools/deploy-infra.sh script from this repo.
The following listing shows the script:
git clone https://github.com/spring-cloud/spring-cloud-pipelines cd spring-cloud-pipelines/ ./tools/deploy-infra.sh
As a result, both
stub runner repos are cloned, built,
and uploaded to Artifactory.
You can skip this step if you have CF installed and do not want to use PCF Dev. The only thing you have to do is to set up spaces.
Servers often run run out of resources at the stage step. If that happens, clear some apps from PCF Dev and continue.
You have to download and start PCF Dev, as described here.
The default credentials for PCF Dev are as follows:
username: user password: pass email: user org: pcfdev-org space: pcfdev-space api: api.local.pcfdev.io
You can start the PCF Dev as follows:
cf dev start
You must create three separate spaces, as follows:
cf login -a https://api.local.pcfdev.io --skip-ssl-validation -u admin -p admin -o pcfdev-org cf create-space pcfdev-test cf set-space-role user pcfdev-org pcfdev-test SpaceDeveloper cf create-space pcfdev-stage cf set-space-role user pcfdev-org pcfdev-stage SpaceDeveloper cf create-space pcfdev-prod cf set-space-role user pcfdev-org pcfdev-prod SpaceDeveloper
You can also run the
./tools/cf-helper.sh setup-spaces script to create the spaces.
If you go to the Concourse website, you should see something resembling the following image:
You can click one of the icons (depending on your OS) to download
fly, which is the Concourse CLI. Once you download that (and maybe, depending on your OS, add it to your PATH) you can run the following command:
fly is properly installed, it should print out the version.
The repository comes with
credentials-sample-cf.yml, which is set up with sample data (mostly credentials) that are applicable for PCF Dev. Copy this file to a new file called
credentials.yml (the file is added to
.gitignore so that you cannot push it with your passwords) and edit it as you wish. For our demo, set up the following:
app-url: URL pointing to your forked
github-private-key: Your private key to clone and tag GitHub repositorys.
repo-with-binaries: The IP is set to the defaults for Docker Machine. You should update it to point to your setup.
If you do not have a Docker Machine, run th
./whats_my_ip.sh script to
get an external IP that you can pass to your
repo-with-binaries, instead of the default
Docker Machine IP.
The following table describes the environment variables required by the scripts:
|Property Name||Property Description||Default value|
Additional options you would like to pass to the Maven / Gradle build
The URL to the CF Api for TEST env
The URL to the CF Api for STAGE env
The URL to the CF Api for PROD env
Name of the org for the test env
Prefix of the name of the CF space for the test env to which the app name will be appended
Name of the org for the stage env
Name of the space for the stage env
Name of the org for the prod env
Name of the space for the prod env
URL to repo with the deployed jars
The id of server from Maven settings.xml
Additional suffix for the route. In a shared environment the default routes can be already taken
The right column shows the default values for PCF Dev that we set in the
BUILD_OPTIONS have no default values.
Log in (for example, for a Concourse instance running at
192.168.99.100 — if you do not provide any value,
localhost is assumed). If you run the login script, it assumes that either
fly is on your
PATH or it is in the same folder as the script. The following example shows how to specify an IP address for the login script:
Next, run the command to create the pipeline, as follows:
Then you can create a
github-webhook pipeline under the
docker alias, using the provided
You can override these values in exactly that order (for example
./set-pipeline.sh some-project another-target some-other-credentials.yml)
The following images show the various steps involved in running the
Figure 7.5. Unpause the pipeline by clicking in the top lefr corner and then clicking the