Skip to content

lifeforms/crs-dev-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

crs-dev-tool

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.

Installation

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/crs

Configuration

Run 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.

Getting and refreshing CRS code

  • crs branch will show you all currently available dev branches, like v3.1/dev
  • crs clean v3.1/dev will initialize your code directory, check out your fork with the v3.1/dev CRS branch, and add the upstream remote. Warning: this will destroy any local content in your code directory!
  • crs merge integrates upstream changes into your fork and code directory. Do this regularly, so you're not too far behind.

Reviewing issues and PRs

  • crs issue will open a browser at the GitHub CRS issues page.
  • crs issue 1234 will open a browser with issue or PR #1234 open.
  • crs review user:branch will check out that user's CRS fork and branch, so you can compare and test.

Testing and debugging

  • crs test will run the full test suite on your local CRS directory.
  • crs test 920470 will only run the tests for ruleId 920470, stored in 920470.yaml.
  • crs serve will run a web server on the CRS at http://localhost/. Try http://localhost/?foo=/etc/passwd!
  • crs shell executes bash inside a running container that's busy testing/serving. It might be used for debugging.

Miscellaneous functions

  • crs update will download the latest version of this shell script from this repository and overwrite itself.
  • crs help will display helpful help.

About

Shell script for automating some common CRS development functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages