Giter VIP home page Giter VIP logo

cf-demo's Introduction

Cloud Demo

This application is a demo cloud native application using Spring Boot and Cloud Foundry. We cover the use of Jenkins and Concourse.

Jenkins Setup

Download and run Jenkins via Docker:

docker run -p 8080:8888 -p 50000:50000 jenkins/jenkins:lts

For convenience, you can also use the bundled docker-compose.yml setup:

docker-compose up

On startup, an autogenerated admin setup password is printed the console. Copy this, then navigate to http://localhost:8888/ or http://192.168.99.100:8888/ depending if you're using Docker natively or via something like Docker Toolbox respectively. Enter this initial password and procede to the next page. Click the "Select plugins to install" option, then on the next page, check the box for "JUnit", then click "Install" at the bottom. When this completes, you'll be prompted to create your first user.

From the home page, navigate to "Manage Jenkins" on the sidebar. Click on "Global Tool Configuration", then scroll down to the Maven section. Click "Add Maven", then give it a name "apache-maven-3.5.2" and "Install from Apache" using that version. Then click "Save" and then go back to "Manage Jenkins" on the sidebar. Now go to "Manage Plugins" and navigate to the "Available" tab. Search for "cloud foundry" in the filter box, select the Cloud Foundry plugin, then click "Install without restart".

Next, click "New Item" on the sidebar. Enter a project name, generally matching the naming scheme of your repository or application name. This is used in URLs and such, so make it convenient for that. We can set a nicer display name later. Select "Multibranch Pipeline" or "Pipeline" and then "OK".

On the next page, add a branch source for your GitHub project. Add credentials from here by adding both your GitHub username/password as an entry with the id "github" and your Cloud Foundry username/password as an entry with the id "pcf". Choose your GitHub credentials, then enter the username/organization and repository name corresponding to your project. Click save, and Jenkins will check out your project. Using the provided Jenkinsfile, this should build and deploy automatically.

Concourse Setup

First, generate SSH keys for Concourse web and slaves via the included script:

./init-concourse-keys.sh

Download and run Concourse via Docker:

docker-compose up

Using the fly CLI tool from Concourse, log in to your instance (replace localhost with 192.168.99.100 if using Docker Toolbox):

fly -t lite login -c http://localhost:8080 -u concourse -p changeme

Next, edit pipeline.yml and change the username and password attributes to your Cloud Foundry details. Then, upload that configuration to Concourse via:

fly -t lite set-pipeline -c pipeline.yml -p cf-demo

Finally, unpause the pipeline to start it:

fly -t lite unpause-pipeline -p cf-demo

Now you can navigate to http://localhost:8080/teams/main/pipelines/cf-demo/ to see the status of this pipeline. (Docker Toolbox users navigate to http://192.168.99.100:8080/teams/main/pipelines/cf-demo/ instead).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.