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
| Technology | Version |
|---|---|
| Java | 8 |
| Wildfly | 13.0.0 |
| MySQL | 8.0 |
| Maven | 3.5 |
| Docker | 17.11.0-ce |
| Docker Compose | 1.17.1 |
- 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
- edit
- Go to jenkins job, build will start in under 2 minutes. Alternatively the build can be started manually -> 'Build Now'
- 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)
-
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
-
$ docker-compose up -d swaggerui -
Swagger UI @
http://localhost:81