Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Latest commit

 

History

History
78 lines (39 loc) · 2.4 KB

continuous-delivery-lab.adoc

File metadata and controls

78 lines (39 loc) · 2.4 KB

CF Workshop Continuous Delivery Lab

Intro

This lab will guide you through building a BASIC continuous delivery pipeline using Jenkins and Cloud Foundry.

Initial Setup

  1. 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`
  2. 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.

  3. Login to your Jenkins instance at https://jenkins-0.pcfsony.com with the same username and password that you use for CloudFoundry.

  4. Navigate to your username folder.

  5. Click Configure and then Credentials, and enter your CloudFoundry credentials. Then click Save.

Create the Build Job

  1. Click New Item, give it the name spring-music and select ``Build a free-style software project.'' Then click OK.

Configure Git
  1. 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.

Configure CF Build Environment
  1. Under Build Environment, select Setup CloudFoundry CLI.

  2. Under API Endpoint, enter https://api.pcfsony.com.

  3. Check Skip SSL Validation.

  4. Under API Credentials select the credentials you configured above.

  5. Enter your Organization and Space for CloudFoundry.

Configure Gradle Build
  1. Select Add Build Step and then Invoke Gradle Script.

  2. Select Use Grade Wrapper.

  3. Check both Make gradlew executable and From Root Build Script Directory.

  4. In switches, enter -Pbuildversion=$BUILD_NUMBER.

  5. In tasks, enter clean assemble.

  6. In build file, enter build.gradle.

  7. Check *Force GRADLE_USER_HOME to use workspace.

Configure CF Push
  1. Select Add Post-build Action and then Push to CloudFoundry.

  2. Under Target, enter https://api.pcfsony.com.

  3. Under Credentials select the credentials you configured above.

  4. Enter your Organization and Space for CloudFoundry.

  5. Check Allow Self-Signed Certificates.

  6. Save the config.

Execute Build Job

  1. Select Build Now.

  2. Select the build in Build History, then select Console Output.

  3. Jenkins should build and push the app, then you can click the link at the bottom to see the running app.