cherry

command module
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2020 License: ISC Imports: 6 Imported by: 0

README

Build Status Go Report Card Test Coverage Maintainability

Cherry

Cherry is an experimental tool and it is WORK-IN-PROGRESS.

Cherry is an opinionated tool for buidling and releasing applications. Currently, Cherry only supports Go for building and GitHub repositories for releasing.

For Go applications, Cherry supports cross-compiling and injecting metadata into the binaries.

Prerequisites/Dependencies

You need to have the following tools installed and ready.

For releasing GitHub repository you need a personal access token with admin access to your repo.

Quick Start

Install
curl -s https://git.io/JeCX6 | sh

Or

curl -s https://raw.githubusercontent.com/moorara/cherry/master/scripts/install.sh | sh
Docker

The docker image for Cherry includes all the required tools and is accessible at moorara/cherry.

Examples

You can take a look at examples to see how you can use and configure Cherry.

Versioning

Cherry uses Semantic Versioning 2.0.0 as described here. For injecting versioning and other metadata into your binaries, you need to have a version package with the following exported variables in it:

var (
  Version   string
  Commit    string
  Branch    string
  GoVersion string
  BuildTool string
  BuildTime string
)

The initial release is always 0.1.0.

Commands

You can run cherry or cherry -help to see the list of available commands. For each command, you can also use -help flag too see the help for that command.

init

cherry init creates and adds the following files required by Cherry. This can be used for initializing a Go repository to work with Cherry.

  • Spec file (cherry.yaml)
  • Version file (version/version.go)
semver

cherry semver resolves and prints the current semantic version. This can be used to get the current semantic version for building other artifacts such as Docker image.

build

cherry build compiles your binary and injects the build information into the version package. cherry build -cross-compile will build the binaries for all supported platforms.

release

cherry release can be used for releasing a GitHub repository. You can use -patch, -minor, or -major flags to release at different levels. You can also use -comment flag to include a description for your release.

CHERRY_GITHUB_TOKEN environment variable should be set to a personal access token with admin permission to your repo.

update

cherry update will update Cherry to the latest version. It downloads the latest release for your system from GitHub and replaces the local binary.

Development

Command Description
make build Build the binary locally
make build-all Build the binary locally for all supported platforms
make test Run the unit tests
make test-short Run the unit tests using -short flag
make coverage Run the unit tests with coverage report
make docker Build Docker image
make push Push built image to registry
make save-docker Save built image to disk
make load-docker Load saved image from disk

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
examples
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL