User Tools
toolsandtechnologies:jenkins_2_grails_dockerized_testing
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| toolsandtechnologies:jenkins_2_grails_dockerized_testing [2019/07/17 05:02] – kfan | toolsandtechnologies:jenkins_2_grails_dockerized_testing [2021/06/25 10:09] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Jenkins - Grails 2 - Dockerised Testing ===== | ||
| + | ==== Motivation ==== | ||
| + | |||
| + | As part of [[https:// | ||
| + | * These pipelines did not allow for concurrent builds due to using the same grails instances | ||
| + | * Current builds would fail at any grails stage if another build from another branch starts | ||
| + | * Tests were also polluted for the same reason if there were multiple builds on going. | ||
| + | |||
| + | This severely decreases the productivity and use of jenkins builds of these applications due to: | ||
| + | * Devs need to wait for on-going builds to be completed before starting their own | ||
| + | * Important builds could fail if another dev pushed their changes and an automatic build was done | ||
| + | * Dev need to send out notices to prevent people from pushing changes + keep watch / kill any builds | ||
| + | |||
| + | |||
| + | To resolve this, docker was installed onto the jenkins server (currently **calliope.err** at the time of writing) and the respective grails project jenkins file was updated to use custom docker grails images for use in the pipeline stages of these projects during build. | ||
| + | |||
| + | ==== Custom Grails Docker Images Project ==== | ||
| + | |||
| + | Custom docker images were built in the server via [[https:// | ||
| + | |||
| + | This project allows for deploying templated Dockerfiles and building the docker images for use in the server. It also allow for removing the images. | ||
| + | |||
| + | ==== Jenkins Pipeline Differences ===== | ||
| + | The main difference was specifying the use of docker images and passing the necessary arguments to help the download/ | ||
| + | |||
| + | agent { | ||
| + | docker { | ||
| + | image ' | ||
| + | args "-v ${GRAILS_CACHE_HOME}:/ | ||
| + | } | ||
| + | } | ||
| + | | ||
| + | environment { | ||
| + | GRAILS_OPTS = " | ||
| + | JAVA_HOME = "/ | ||
| + | } | ||
| + | |||
| + | The defaults values for the artifactoryIp and GRAILS_CACHE_HOME were put into the [[https:// | ||
| + | |||
| + | ==== Sample Templated Variables ==== | ||
| + | |||
| + | Required templates params are passed via the [[https:// | ||
| + | |||
| + | jenkins_dockerfile_home_path: | ||
| + | jenkins_docker_grails_apps: | ||
| + | - name: Ticketer | ||
| + | java: 7 | ||
| + | grails: 2.2.4 | ||
| + | tag: jenkins/ | ||
| + | - name: NocPortal | ||
| + | java: 7 | ||
| + | grails: 2.2.4 | ||
| + | tag: jenkins/ | ||
| + | - name: SnmpManager | ||
| + | java: 7 | ||
| + | grails: 2.5.6 | ||
| + | tag: jenkins/ | ||
| + | - name: ReportingManager | ||
| + | java: 7 | ||
| + | grails: 2.2.4 | ||
| + | tag: jenkins/ | ||
| + | |||
| + | ==== Ansible Commands ==== | ||
| + | For the ansible commands for the creation and removal of the docker images, please see the readme of the [[https:// | ||