Skip to content

Latest commit

 

History

History
90 lines (60 loc) · 3.13 KB

CONTRIBUTING.md

File metadata and controls

90 lines (60 loc) · 3.13 KB

Contributing to rhtap-cli

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

Building

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

Container Image

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.

Testing

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

Running

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

GitHub Release

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:

  1. Go to the releases page
  2. Click on "Create a new release" button
  3. Choose the tag you want to release, the tag must start with v and follow the semantic versioning pattern.
  4. Fill the release title and description
  5. Wait for the release workflow to finish and verify the release assets

Release Automation

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"