Giter Site home page Giter Site logo

jenkins-cicd's Introduction

jenkins-cicd

Testing out Junit test cases with Jenkins CI pipeline

PipeLine

pipeline

This is the basic concept of developer pushing the code to get it automatically build and deployed in docker hub using Jenkins. Continuous Integration.

jenkins-configuration

Here are the main steps to setup Jenkins pipeline.

  • General : Description of the pipeline, github project uri
  • Source Code Management: Git repository and credentials and which branch/es to follow by Jenkins.
  • Build Triggers: Build Periodically and Poll Scm (follows cron syntax)
  • Build Environment: If some pre configurations needed
  • Build Steps: mvn clean package (to build a runnable JAR file, that will be deployed) then using Docker-pipeline plugin create,tag and push image to docker hub (arkamallick namespace).
  • Post-build Actions: After the build steps is over, update the status in github using status backref. CI complete.

tick

Dockerize the app

  • pom has a spring-boot-maven-plugin plugin configured which takes care of generating a runnable jar
  • added Dockerfile

To build & run the docker image:

docker image build -t docker-jenkins-java-jar:latest . 

Here the snapshot will be repackaged and tagged docker-jenkins-java-jar (because of -t), . at the end signifies the location of the Dockerfile.

 docker run docker-jenkins-java-jar:latest 

Jenkins Docker plugins

Installed Docker Pipeline. Manage Nodes and Clouds (under manage Jenkins) -> add a cloud -> added Docker there as cloud

Docker creds

I have a Docker Hub account, created new access token. Adding the creds in jenkins:

Dashboard -> Manage Jenkins -> Credentials -> System -> Global credentials (unrestricted)

Debugging Notes

Docker integration does not work out of the box. Turns out that the jenkins uses Docker REST Api underneath and needs to be configured. Docker does not allow remote access by deafault and needs to be configured, like this worked.

https://stackoverflow.com/a/60728186/1578967

manage jenkins -> Configure System -> Docker Builder Tried the connection to tcp://127.0.0.1:2375 and test Connection worked Hint: First the docker desktop has to be running and Docker engine is accessible via DD.

test connection

Links

https://www.jenkins.io/doc/book/installing/kubernetes/

https://phoenixnap.com/kb/how-to-configure-docker-in-jenkins

Appendix:

Detailed screenshots of the pipeline configuration

jenkins-cicd's People

Contributors

haramoz avatar

Watchers

 avatar  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.