Code Monkey home page Code Monkey logo

petclinic-project's Introduction

Jenkins Pipeline for Spring-PetClinic Project (Deploy to DockerHub)

Introduction

Pipeline built in Jenkins for the Spring project: https://github.com/spring-projects/spring-petclinic.

Dockerhub Links

Prerequisites

  • Install wget using brew: brew install wget.
  • Docker installed.

Running the Project

  1. Clone the project:
    git clone https://github.com/talitz/spring-petclinic-jenkins-pipeline.git

  2. CD into the project and provide permissions to the shell running scripts:

  • cd spring-petclinic-jenkins-pipeline
  • chmod 755 *.sh
  1. Run a containerized Docker & Jenkins environemnt using (please provide your password when prompted):
    ./start.sh
    Note: this takes time, due to the download folder of 'jenkins_home'; it contains all the necessary configurations (job, plugins, etc) for the project to be initialized without manually installing Jenkins.

  2. Browse into localhost:8080 and insert the following username & password:

  • username: 'admin'.
  • password: run the following command in a new terminal and insert the output as a password:
    docker exec jenkins-docker cat /var/jenkins_home/secrets/initialAdminPassword
  • Please verify the password for the tyitzhak user in docker hub is the same in Jenkins Credentials Manager - unless you'll get bad credentials error in deploying to dockerhub.
  1. Go into the 'spring-petclinic-hub' job, and click on 'Build now'.
    Open BlueOcean and follow the pipeline. When it is done (it takes more then 15 minutes, the 'Compile' step takes time) it should look like that:


Note: If one of the stages fails, due to connection/unrelated issues, re-run the stage in Jenkins (shouldn't happen, but just in case).

How to use the Runnable Docker Image?

The runnable docker image is stored at tyitzhak/spring-petclinic-hub:latest.

Pull the latest petclinic-container image from the dockerhub repository:
docker pull tyitzhak/spring-petclinic-hub:latest

Run the container using:
docker run -d --name petclinic-container -p 8181:8181 tyitzhak/spring-petclinic-hub:latest

Go into localhost:8181 (it takes about ~10 seconds until the application is up).
Your application is now READY! :)

You can run the container's shell using:
docker exec -it petclinic-container sh

Terminate the Project

Run ./terminate.sh.

petclinic-project's People

Contributors

talyitzhak avatar lekhachowdary avatar

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.