Skip to content

rcwbr/release-it-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

release-it-docker

Docker image wrappers for release-it

Usage

Base image usage

The base image includes the release-it tool only. To use the image:

docker run -it ghcr.io/rcwbr/release-it-docker:0.1.0

The container entrypoint is the release-it CLI executable.

Conventional-changelog image usage

The conventional-changelog image includes the conventional-changelog release-it plugin. To use the image:

docker run -it ghcr.io/rcwbr/release-it-docker-conventional-changelog:0.1.0

File bumper image usage

The file-bumper image includes the bumper release-it plugin. To use the image:

docker run -it ghcr.io/rcwbr/release-it-docker-file-bumper:0.1.0

If using the default configuration, it is configured to bump versions in a plaintext VERSION file. By default, it will replace the entire contents of the file with the version number.

⚠️ Unlike the other images, the bumper release-it default configuration sets git.commit true (as the version file bump must be committed) and git.pushArgs to ["tags"] so as to push the tag only and not commit to the default branch. It also configures git.getLatestTagFromAllRefs true so that the latest tag may still be discovered despite not being associated with a commit on the default branch.

Default configurations

Both the base and conventional-changelog images provide a default release-it configuration, located at /.release-it.json. To use this config, provide an arg to release-it:

docker run -it ghcr.io/rcwbr/release-it-docker:0.1.0 --config /.release-it.json

GitHub workflow usage

The recommended approach to apply this image in a GitHub workflow is via the reusable release-it-gh-workflow.

Contributing

Build

The recommended method to build the image is using Docker Bake and the Dockerfile partials GitHub cache bake file. The steps to build the image using this method are as follows.

Prepare a Docker builder with the docker-container driver:

docker builder create --use --bootstrap --driver docker-container

Authenticate to GitHub container registry (see instructions):

echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin

Build base image

Build the image:

cd base
REGISTRY=ghcr.io/rcwbr/ IMAGE_NAME=release-it-docker docker buildx bake --file github-cache-bake.hcl 'https://github.com/rcwbr/dockerfile-partials.git#main'

Build conventional-changelog image

cd conventional-changelog
REGISTRY=ghcr.io/rcwbr/ IMAGE_NAME=release-it-docker-conventional-changelog docker buildx bake --file github-cache-bake.hcl --file cwd://docker-bake.hcl 'https://github.com/rcwbr/dockerfile-partials.git#main'

CI/CD

This repo uses the release-it-gh-workflow, with the conventional-changelog image defined at any given ref, as its automation.

Settings

The GitHub repo settings for this repo are defined as code using the Probot settings GitHub App. Settings values are defined in the .github/settings.yml file. Enabling automation of settings via this file requires installing the app.

The settings applied are as recommended in the release-it-gh-workflow usage, including tag and branch protections, GitHub App and environment authentication, and required checks.