-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add built binary to .gitignore * create makefile * create developer docs * quote ignored jobs * new line * use macos build agent * use ubuntu; update importer install cmd
- Loading branch information
Jon Corbin
authored
Nov 23, 2022
1 parent
1aec150
commit a231533
Showing
4 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ | |
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# Built binary | ||
merge-gatekeeper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
TOKEN=${GITHUB_TOKEN} | ||
REF=main | ||
REPO=upsidr/merge-gatekeeper | ||
IGNORED="" | ||
|
||
go-build: | ||
GO111MODULE=on LANG=en_US.UTF-8 CGO_ENABLED=0 go build ./cmd/merge-gatekeeper | ||
|
||
go-run: go-build | ||
./merge-gatekeeper validate --token=$(TOKEN) --ref $(REF) --repo $(REPO) --ignored "$(IGNORED)" | ||
|
||
docker-build: | ||
docker build -t merge-gatekeeper:latest . | ||
|
||
docker-run: docker-build | ||
docker run --rm -it --name merge-gatekeeper merge-gatekeeper:latest validate --token=$(TOKEN) --ref $(REF) --repo $(REPO) --ignored "$(IGNORED)" | ||
|
||
test: | ||
go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Working with Merge Gatekeeper locally | ||
|
||
## Requirements | ||
|
||
- [`go` >= 1.16.7](https://go.dev/doc/install) | ||
- [A valid github token with `repo` permissions](https://github.com/settings/tokens) | ||
- [make](https://en.wikipedia.org/wiki/Make_(software)) | ||
|
||
## Useful but not required | ||
|
||
- [`docker`](https://docs.docker.com/engine/install/) | ||
- required for building and running via docker | ||
|
||
## Building Merge Gatekeeper | ||
|
||
Using the [`Makefile`](./../Makefile) run the following to build: | ||
```bash | ||
# build go binary | ||
make go-build | ||
|
||
# build docker container | ||
make docker-build | ||
``` | ||
|
||
## Running Merge Gatekeeper | ||
|
||
it is recommend to export you [github token with `repo` permissions](https://github.com/settings/tokens) to the environment using | ||
```bash | ||
export GITHUB_TOKEN="your token" | ||
``` | ||
otherwise, you will need to pass your token in via | ||
```bash | ||
GITHUB_TOKEN="your token" make go-run | ||
``` | ||
|
||
Using the [`Makefile`](./../Makefile) run the following to run: | ||
```bash | ||
# build and run go binary | ||
make go-run | ||
|
||
# build and run docker container | ||
make docker-run | ||
``` | ||
|
||
## Testing | ||
To test, use the makefile: | ||
|
||
```bash | ||
make test | ||
``` |