A Small Ship in the DevOps sea
Part 2 - Selecting the DevOps Tools
Introduction
Part 1 looked at some of the basic principes of DevOps and Continuous Development as they relate to small projects.
The Starting Point
Currently I use:
- Java for development
- Gradle for build management (although not very well - this needs improvement)
- GitHub for issue tracking and central repo for open source projects
- BitBucket for issue tracking and central repo for closed source projects
- Spock for unit and integration testing
- Travis CI but really only to provide the "passing" badge ... Gradle does the work
- Coveralls as a way of presenting coverage stats on GitHub.
- FindBugs for static analysis
- Docker to create test environments
- Vaadin TestBench for functional testing of Vaadin apps - only useful if you use Vaadin of course
- Intellij IDEA Ultimate Edition as IDE
Test coverage is generally good, and static analysis fully managed (that is, raised issues are dealt with).
I have a release process which generates release notes and partly automates the process, but it is a bit flaky and needs rework. It is this which started me off on the DevOps journey.
Selecting the Tools
This list may grow .. or change ... as I progress, but there are so many tools to choose from I need to start somewhere.
Some are self-selecting because I already use them and am happy with them. Gradle, Spock and Vaadin TestBench fall into this category. (An earlier post describes my experiences of Spock)
One specific consideration is that whatever environments I need (including a build environment) should be definable as code - infrastructure & Ops are definitely my weak points, so would benefit massively from automation.
- Principle 5: Environments / infrastructure defined in code and version controlled.
Docker
At the moment Docker is the only serious candidate to meet Principle 5.
Composing
Docker compose and/or Terraform
CI / task orchestration
The obvious candidate is Jenkins although there are quite a few others, particularly if you include hosted services. I do not want to incur costs at this stage though, so I am restricting the choice to installable tools, and in particular those which have a Docker image.
I installed Jenkins(via Docker) and that worked Ok, but I did find Jenkins quite hard to set up and in danger of conflicting with what was set up in Gradle.
I will come back to this, but at the moment I am wondering whether a "proper" CI server is really necessary given the simple orchestration I need, and a distributed build probably unnecessary. (This assumes that Gradle is the primary tool (Principle 3 in previous post))
On the other hand, I really do not want to be re-inventing anything.
Repository Manager
Artifactory for artifacts through the build process
Bintray for released artifacts
Lifecycle tasks
Given Principle 3, each step in the diagram should have an associated Gradle task.
- Trigger from Git - TBD
- Unit Tests - Spock / JUnit
- Integration Tests - Spock / JUnit
- Sonar scan - Sonar plugin
- Quality gate - coded in Gradle, using Jacoco report (experimental version looks good)
- Sonar gate - deferred; there are some notes on the Sonar site
- Create build info - bespoke
- Changelog and Release Notes - GitPlus plugin - in progress
- Push to Artifactory - Artifactory plugin
- Pull from Artifactory - Artifactory plugin
- Deploy to test - Docker plugin
- Functional test - app specific. Vaadin TestBench for Vaadin apps
- Pull from Artifactory - Artifactory plugin
- Deploy to UAT - Docker plugin
- UAT - manual. Needs something to flag completion / failure
- Pull from Artifactory - Artifactory plugin
- Tag release - GitPlus plugin
- Merge to master - GitPlus plugin
- Push master and tags to origin - GitPlus plugin
- Push to Bintray - Bintray plugin
- Deploy to Production - Docker plugin
Notes
The GitPlus plugin is currently being developed
Author of Krail