tecris / continuous-delivery

Docker/docker-compose continuous testing/delivery for a java web application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java Continuous Delivery by Docker

Circle CI Build Status

Continuous delivery demo that aims to use following principles:

  • immutable environments
  • short lived environments
  • built and destroyed with each jenkins run

Continuous delivery with Jenkins (on-prem)

E2E with Docker Compose and Maven

Swagger

Stack

Technology Version
Java 8
Wildfly 13.0.0
MySQL 8.0
Maven 3.5
Docker 17.11.0-ce
Docker Compose 1.17.1

Continuous delivery with Jenkins

  • Start jenkins
    • $ ./startJenkins.sh
    • login to jenkins (password can be seen in jenkins log when it starts)
    • select 'Install selected plugins'
  • Create jenkins plan
    • edit ./jenkins/data
    • $ cd jenkins && ./createJob.sh localhost 8080 continuous-delivery config.xml
  • Go to jenkins job, build will start in under 2 minutes. Alternatively the build can be started manually -> 'Build Now'
Continuous Delivery life-cycle
  • Source code changes pushed to git
  • Jenkins detects changes and starts job
    • Build war/jar artifact
    • Start stack (includes image build for java web app)
    • Apply db schema (flywaydb.org)
    • Execute integration tests
    • Stop stack (includes destroy of web and database containers)

E2E with docker compose and Maven

  • Step-by-step

      $ TAG=dev docker-compose up -d ackris-db ackris-web                     # start web and database containers
      $ mvn clean compile flyway:migrate                                      # deploy database schema
      $ mvn clean verify -Dmaven.test.failure.ignore=false -Dtest.port=8070   # run integration tests

Use -Dmaven.buildNumber.doCheck=false if project contains local changes

Demo: http://localhost:8070/bookstore

Swagger

  • $ docker-compose up -d swaggerui

  • Swagger UI @ http://localhost:81

About

Docker/docker-compose continuous testing/delivery for a java web application


Languages

Language:Java 46.9%Language:JavaScript 27.0%Language:HTML 21.5%Language:Shell 1.4%Language:Groovy 1.0%Language:CSS 1.0%Language:Gherkin 0.6%Language:Dockerfile 0.6%