/gonut

gonut is a portable tool to help you verify whether you can push a sample app to a Cloud Foundry

Primary LanguageGoMIT LicenseMIT

gonut

License Go Report Card Build Status GoDoc Release

gonut

Introducing gonut

gonut is a portable tool to help you verify whether you can push a sample app to a Cloud Foundry. It will push an app to Cloud Foundry and delete it afterwards. The apps are embedded into the gonut binary, so you just have to install gonut and you are set.

It is written in Golang and uses pina-golada to include arbitrary sample app data in the final binary.

gonut example

This project is work in progress.

How do I get started

Installation options are either using Homebrew or a convenience download script.

  • On macOS systems, a Homebrew tap is available to install gonut:

    brew install homeport/tap/gonut
  • Use a convenience script to download the latest release to install it in a suitable location on your local machine:

    curl -fsL http://ibm.biz/Bd2t2v | bash

Contributing

We are happy to have other people contributing to the project. If you decide to do that, here's how to:

  • get Go (gonut requires Go version 1.11 or greater)
  • fork the project
  • create a new branch
  • make your changes
  • open a PR.

Git commit messages should be meaningful and follow the rules nicely written down by Chris Beams:

The seven rules of a great Git commit message

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how

Running test cases and binaries generation

There are multiple make targets, but running all does everything you want in one call.

make all

Test it with Linux on your macOS system

Best way is to use Docker to spin up a container:

docker run \
  --interactive \
  --tty \
  --rm \
  --volume $GOPATH/src/github.com/homeport/gonut:/go/src/github.com/homeport/gonut \
  --workdir /go/src/github.com/homeport/gonut \
  golang:1.11 /bin/bash

Git pre-commit hooks

Add a pre-commit hook using this command in the repository directory:

cat <<EOS | cat > .git/hooks/pre-commit && chmod a+rx .git/hooks/pre-commit
#!/usr/bin/env bash

set -euo pipefail
make test

EOS