In order to contribute to this project you need the following requirements:
All the automation needed for the project lives in the Makefile. This file is the entry point for all the automation tasks in the project for CI, development and release
After you have cloned the repository and installed the requirements, you can start building. For that purpose you can simply run make
, the default target builds the application in the bin
directory
make
In order to build a container image out of this project run the following target:
make image IMAGE_REPO="ghcr.io/redhat-appstudio/rhtap-cli" IMAGE_TAG="latest"
The IMAGE_REPO
and IMAGE_TAG
are optional variables, you should use your own repository and tag for the image.
Unit testing is done using the go test
command, you can run the tests with the following target:
make test-unit
Alternatively, run all tests with:
make test
To run the application you can rely on the run
target, this is the equivalent of go run
command. For instance:
make run ARGS='deploy --help'
Which is the equivalent of:
make &&
bin/rhtap-cli deploy --help
This project uses GitHub Actions to automate the release process, triggered by a new tag in the repository.
To release this application using the the GitHub web interface follow the steps:
- Go to the releases page
- Click on "Create a new release" button
- Choose the tag you want to release, the tag must start with
v
and follow the semantic versioning pattern. - Fill the release title and description
- Wait for the release workflow to finish and verify the release assets
For the release automation the following tools are used:
gh
: GitHub helper CLI, ensure the release is created, or create it if it doesn't exist yet.goreleaser
: Tool to automate the release process, it creates the release assets and uploads them to the GitHub release.
The release workflow relies on the make github-release
target, this Makefile
target is responsible for ensure the release is created, or create it using gh
helper, build and upload the release assets using goreleaser
.
The GitHub workflow provides GITHUB_REF_NAME
environment variable to the release job, this variable is used to determine the tag name to release.
make github-release GITHUB_REF_NAME="v0.1.0"