rprel

Rprel (arr-pee-rell) is a tool for creating GitHub releases from a build artifact.

Contents

Building the exectuable:

Rprel is built in Elixir so you will need Erlang && Elixir installed to use/modify it.

You can find instructions on installation here.

We use exenv for managing the Elixir version.

Once everything is installed, you can run:

$ git clone git@github.com:rentpath/rprel.git
$ cd rprel
$ mix deps.get
$ mix escript.build

This builds the executable, which is accessible like so:

$ rprel

Usage

Rprel will publish a release to GitHub. This takes advantage of the GitHub Release API. In particular, it uses Create a Release and Upload a release asset.

You can see information about rprel by running:

$ rprel --help

To access information that is build specific:

$ rprel build --help

To access information that is release specific:

$ rprel release --help

All --help commands are aliased to -h, so:

$ rprel -h is equivalant to $ rprel --help

To use Rprel and create a build simply run:

cd source_code/
rprel build --commit master --build-number 100

As you can see, there are 2 required flags:

An example build:

cd source_code/
rprel build --commit 09d5671224b03969c629d9265417bc82c4aac48f --build-number 100

This will create a tarball of the directory source_code/ named 20160613-100-09d5671.tgz containing a BUILD-INFO file in the following format:

---
version: 20160613-100-09d5671
build_number: 100
git_commit: 09d5671224b03969c629d9265417bc82c4aac48f

To use Rprel and create a release simply run:

$ rprel release --repo "repo_owner/repo_name" --version "<version_name>" --commit "<branch_or_sha>" --token "AUTH_TOKEN" [list_of_files]

As you can see, there are 4 required flags:

An example release:

 $ rprel release --repo rentpath/test-bed --version "V1.0.0" --commit "master" 20160613-100-09d5671.tgz

will create release V1.0.0 of rpenv and will upload 20160613-100-09d5671.tgz`` as a release artifact. # Running the tests: All the tests can also be run with: $ mix test To run the tests on save, run: $ mix test.watch# Running CredoRpreluses [Credo](https://github.com/rrrene/credo) for code analysis. To run: ``` $ mix credo --strict ``` Please execute this before commiting, and address issues thatcredofinds. # Contributing - Follow the instructions above to installelixir` and get the repo running. - If you modify code, add a corresponding test (if applicable). - Create a Pull Request (please squash to one concise commit). - Thanks! # License MIT