pszymczyk / embedded-consul

Embedded Consul provides easy way to run Consul in integration tests.
Apache License 2.0
95 stars 29 forks source link

Automatic Continuous Delivery from CI server #103

Closed szpak closed 4 years ago

szpak commented 4 years ago

Automatic Continuous Delivery from CI server

This PR add an ability to automatically release the new version of embedded-consul to Maven Central from CI server, on demand. By the automation of the all manual steps needed to be performed on a local workstation, it opens an ability to release the new version every time the new features or fixes are in master.

Introduction

The release process has been implemented with the [CDeliveryBoy](), a Continuous Delivery plugin for Gradle. It greatly simplifies the configuration required for CD in a project, by providing sane defaults, whenever possible.

Features

Releasing

Assuming we are in master:

git commit -m "Trigger build" -m "[#DO_RELEASE]" --allow-empty
git push

and wait a few (or maybe several) minutes - doing push-ups or other healthy activities - to see the artifacts in Maven Central!

Btw, [#DO_RELEASE] can be also added to the commit with a new feature or a bug to trigger the release after push.

Releasing an arbitrary version number

[#DO_RELEASE] is configured to release the new version with incremented patch number (e.g. 1.1.5 -> 1.1.6). However, CDeliveryBoy has a sophisticated mechanism to release an arbitrary version:

Changelog synchronisation with GitHub releases

As a bonus feature the locally provided changelog is synchronized with GitHub releases, which is very convenient for people receiving notification about new versions (e.g. with GitPunch).

Version update in README

As a part of release process the versions used in example configuration of the project in Gradle and Maven are automatically updated. No more manual version changes in README :-).

Limitations

CDeliveryBoy has been created by Marcin Zajączkowski to be used in his FOSS projects. It is currently used in multiple projects, however, it was not intended to be a general usage CD tool for everyone. As a result, it is currently in the maintenance mode with some known limitations.

No support for maven-publish plugin

CDeliveryBoy uses the maven plugin which currently is deprecated. As a result it might be problematic to build the project with Gradle 7+.

Additional info

The changes are separated into 4 commits to make it easier to analyze applied changes. I recommend to merge with WITHOUT squashing to preserve it for further analysis.

Fixed #95, fixes #37.