This lab will guide you through building a BASIC continuous delivery pipeline using Jenkins and Cloud Foundry.
-
Fork the Spring-Music repository. If you do not have a github account, you can skip this step and use my repository.
`https:\\https://github.com/cloudfoundry-samples/spring-music.git`
-
Edit the manifest.yml at the root of the forked spring-music repository. Change the host from ${random-word} to your initials. Jenkins does not like the special characters in the host field and will give an error.
-
Login to your Jenkins instance at https://jenkins-0.pcfsony.com with the same username and password that you use for CloudFoundry.
-
Navigate to your username folder.
-
Click Configure and then Credentials, and enter your CloudFoundry credentials. Then click Save.
-
Click New Item, give it the name spring-music and select ``Build a free-style software project.'' Then click OK.
-
Under Source Code Management, select Git, and supply your repository URL (e.g.
https://github.com/<YOUR_GIT_USERNAME>/spring-music
). Leave credentials as none.
-
Under Build Environment, select Setup CloudFoundry CLI.
-
Under API Endpoint, enter
https://api.pcfsony.com
. -
Check Skip SSL Validation.
-
Under API Credentials select the credentials you configured above.
-
Enter your Organization and Space for CloudFoundry.
-
Select Add Build Step and then Invoke Gradle Script.
-
Select Use Grade Wrapper.
-
Check both Make gradlew executable and From Root Build Script Directory.
-
In switches, enter
-Pbuildversion=$BUILD_NUMBER
. -
In tasks, enter
clean assemble
. -
In build file, enter
build.gradle
. -
Check *Force GRADLE_USER_HOME to use workspace.
-
Select Add Post-build Action and then Push to CloudFoundry.
-
Under Target, enter
https://api.pcfsony.com
. -
Under Credentials select the credentials you configured above.
-
Enter your Organization and Space for CloudFoundry.
-
Check Allow Self-Signed Certificates.
-
Save the config.