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.buildThis builds the executable, which is accessible like so:
$ rprelUsage
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 100As you can see, there are 2 required flags:
Commit: The current commit sha of the repository you are building.
Build Number: The build number from your CI test run.
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:
Repo: The repo where the release will be created.
Version: This is the version to release.
Commit: The branch or
shato be released.Token: A GitHub Auth Token See Here for information about auth tokens. While the GitHub auth token can be set using the
--tokenflag, we strongly recommend setting the token in theGITHUB_AUTH_TOKENenvironment variable to keep the token from appearing in your command history.Files: This is a file or list of files to be released,
foo.txt bar.txtfor example, or the tarball created by therprel buildstep20160613-100-09d5671.tgz
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