Skip to content

Commit

Permalink
Merge pull request #56 from cultureamp/contributing
Browse files Browse the repository at this point in the history
docs: add contribution docs
  • Loading branch information
ctgardner authored Jun 23, 2024
2 parents 8f46c89 + a1e4139 commit 4777e4f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing to the plugin

The plugin is licensed under the MIT license, and we welcome your contributions!

If you are planning to make a larger contribution, please be sure to to raise an
issue first. This allows for conversation and helps us plan to support the
changes being contributed.

## Making contributions

The core of this plugin is in Go. Contributions must be accompanied by unit
tests, and have some level of practical smoke testing completed against ECR.

Useful commands:

```shell
# all Go source is under `src/`
cd src

# running tests
go test ./...

# create the executable
go build
```

## Running the plugin locally

Buildkite plugins [take their input parameters as environment
variables][plugin-docs]. In local development we use
[`direnv`](https://direnv.net/) to set these appropriately.

There is an `.envrc` file present in the repository root. Follow the
instructions in this file to create your own `.envrc.private` file that can be
activated with `direnv allow`.

Set the value of `BUILDKITE_PLUGIN_ECR_SCAN_RESULTS_IMAGE_NAME` in the
`.envrc.private` file to point the plugin at a particular image, and ensure that
you have assumed a role that has access to the ECR registry in question.

Then, `go build` to create the executable and `./ecrscanresults` to run.

```shell
cd src

# apply modifications to env variables
direnv allow

# build and execute
go build && ./ecrscanresults
```

[plugin-docs]: https://buildkite.com/docs/plugins/writing#step-2-add-a-plugin-dot-yml
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ steps:
> Prefer defining an ignore file over using thresholds, and use the `reason`
> field to explain why the vulnerability is being ignored.

## Making contributions

Contributions are welcome! See the [Contributions Guide](./CONTRIBUTING.md) for
information about running the plugin locally for testing.

## Configuration

### `image-name` (Required, string)
Expand Down

0 comments on commit 4777e4f

Please sign in to comment.