Giter Club home page Giter Club logo

hello-jenkinspipelines's Introduction

Hello Jenkins Pipelines

This projekt is a simple example how to use Jenkins Pipelines to build and containerize a project, having the infrastructure available as Docker image as well. The project is based on Java/SpringBoot and is packaged and containerized with Docker.

Infrastructure

The infrastructure is located in the folder /build-env. The Dockerfile describes the Jenkins base Docker image extended by Maven and Docker itself. Maven is required to build the project, Docker tooling is needed to build and push the Docker image.

The docker-compose-yml bundles the custom Jenkins image with the standard Docker registry and a web frontend for the registry.

Project

The project itself is quite small, it just consists of a static page. To build the project, you may use mvn clean verify. This will build, test, package and, for convenience, bundle the project with it's dependencies in a single jar.

Execution

Run the infrastructure stuff

Simply execute docker-compose build to build the respective docker images and docker-compose up in the /build-env folder. Hello Jenkins at http://localhost:8081. You need to setup your Jenkins, please do as you're told ;)

Create a Jenkins project

Create a Multi-Branch Project on your Jenkins build server. Map the project to github.com:stefanreichert/hello-jenkinspipelines.git (or any other project you like...). Since the build server will use the Jenkinsfile no further configuration is required. Your project will automatically be built, the result will be pushed to your local Docker registry at http://localhost:5000. That's basically it...

Watch the result

There is a registry UI deployed with the infrastructure. At http://localhost:8082 you will find a web frontend exposing your registry content. Your build results will show up here.

Noteworthy

There will be state on your host machine...

  • Jenkins home folder ~/tmp/docker/jenkins/home
  • Maven home folder ~/tmp/docker/maven/home

In order to allow Docker tooling inside a Docker image, the Jenkins images maps the Docker socket file as volume to share the engine with the container. Seems to good practice ;)

hello-jenkinspipelines's People

Contributors

stefanreichert avatar

Stargazers

 avatar

Watchers

 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.