Skip to content

Latest commit

 

History

History
112 lines (74 loc) · 2.78 KB

development.md

File metadata and controls

112 lines (74 loc) · 2.78 KB

Developer setup

Interested in contributing to Masonry? Awesome! Take a look at our contribution guidelines first.

Project setup

  1. Install Go 1.9+, and ensure your GOPATH is set. Using gvm is recommended.

  2. Get the code.

    go get github.com/opencontrol/compliance-masonry
  3. Run the tool.

    compliance-masonry

This should print out usage documentation.

  1. Install make. See GNU Make for details on what make is and can do.

    yum-based systems (RHEL / CentOS / etc.):

    sudo yum install make

    apt-based systems (Ubuntu / etc.):

    sudo apt-get install build-essential

    MacOS systems: First, install Homebrew. Then, install make:

    brew install make
    
  2. Makefile targets:

    make [target-name]

    The common targets include:

    • all - Performs a build
    • build - Builds the source code and places compliance-masonry binary into the ./build folder.
    • clean - Simply removes the ./build folder
    • test - Runs the tests.
    • lint - Checks to see if the Go code is properly formatted. (If you want to contribute to the project, use this target; you will need to make sure your code follows accepted standards.)

Updating dependencies

As the dependencies now exist in the git tree under the vendor/ folder, dependencies should only have to be updated when they are out-of-date, need to stick to a specific version, or need to add a new dependency.

  1. Get the dep tool.

    https://golang.github.io/dep/docs/installation.html

  2. When needed, update dependencies by running the dep tool in the project.

    dep ensure -update github.com/foo/bar
  3. You can add dependencies using dep.

    dep ensure -add github.com/foo/bar
  4. If dependencies are not in the vendor/ folder, you can use the dep tool to make everything proper.

    dep ensure

Running tests

make test

Tagging a New Release

  1. Checkout the master branch NOTE: Make sure that the master branch is clean and has the latest commits from GitHub.

    git checkout master
  2. Using v.1.1.1 as an example, tag the new release using the convention in the example below:

    git tag -m "Bump to v1.1.1" v1.1.1
  3. Using v1.1.1 as an example, push the tag back to GitHub

    git push origin v1.1.1
  4. CircleCI will then run through the tests. Since there is a new tag, CircleCI will also install and run GoReleaser which will build and upload the binaries for release.