Shell script for automating some common CRS development functions.
Using Docker, it allows you to develop the CRS on your local machine without any infrastructure.
Necessary dependencies: awk, curl, Docker, git.
Currently tested only on macOS, will accept patches to improve this.
Download the script anywhere you like to store random programs, like ~/bin:
curl -o ~/bin/crs https://raw.githubusercontent.com/lifeforms/crs-dev-tool/master/crs.sh
chmod a+x ~/bin/crsRun crs once to create an example configuration file ~/.crs.
Edit the file ~/.crs in your favorite editor, defining your CRS code directory and the URL of your CRS Github fork. If you haven't made a fork yet, the file will give you instructions on how to do this.
crs branchwill show you all currently available dev branches, likev3.1/devcrs clean v3.1/devwill initialize your code directory, check out your fork with thev3.1/devCRS branch, and add the upstream remote. Warning: this will destroy any local content in your code directory!crs mergeintegrates upstream changes into your fork and code directory. Do this regularly, so you're not too far behind.
crs issuewill open a browser at the GitHub CRS issues page.crs issue 1234will open a browser with issue or PR #1234 open.crs review user:branchwill check out that user's CRS fork and branch, so you can compare and test.
crs testwill run the full test suite on your local CRS directory.crs test 920470will only run the tests for ruleId 920470, stored in 920470.yaml.crs servewill run a web server on the CRS at http://localhost/. Try http://localhost/?foo=/etc/passwd!crs shellexecutes bash inside a running container that's busy testing/serving. It might be used for debugging.
crs updatewill download the latest version of this shell script from this repository and overwrite itself.crs helpwill display helpful help.