Compare commits
3 Commits
a4ce793707
...
e25b192aff
Author | SHA1 | Date |
---|---|---|
Urko | e25b192aff | |
Urko | ca4541ca1a | |
Urko | e02c244425 |
|
@ -1,3 +1,4 @@
|
||||||
.env
|
.env
|
||||||
coverage/*
|
coverage/*
|
||||||
test_monitor.txt
|
test_monitor.txt
|
||||||
|
bin
|
6
Makefile
6
Makefile
|
@ -1,4 +1,5 @@
|
||||||
|
BINARY_DIR=bin
|
||||||
|
BINARY_NAME=webhook-listener
|
||||||
COVERAGE_DIR=coverage
|
COVERAGE_DIR=coverage
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
|
@ -14,3 +15,6 @@ test-coverage:
|
||||||
go tool cover -html ${COVERAGE_DIR}/cover.out -o ${COVERAGE_DIR}/cover.html
|
go tool cover -html ${COVERAGE_DIR}/cover.out -o ${COVERAGE_DIR}/cover.html
|
||||||
cd ${COVERAGE_DIR}
|
cd ${COVERAGE_DIR}
|
||||||
open cover.html
|
open cover.html
|
||||||
|
build:
|
||||||
|
mkdir ${BINARY_DIR}
|
||||||
|
go build -o ${BINARY_DIR}/${BINARY_NAME}
|
19
README.md
19
README.md
|
@ -1,5 +1,7 @@
|
||||||
# git-webhook-ci
|
# git-webhook-ci
|
||||||
Tool to automatize your deploy based on file write changes
|
Tool to automatize your deploy based on file write changes
|
||||||
|
## Description
|
||||||
|
After some change is made in our listener file the script placed on path set on `env` variable called **WEBHOOK_SCRIPT_PATH** will be executed.
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
As a security risk that could be allow a webhook listener on a VPS for your git repository, I've decided
|
As a security risk that could be allow a webhook listener on a VPS for your git repository, I've decided
|
||||||
|
@ -16,3 +18,20 @@ you shold place on your server to run desired tasks. In my case I've done this t
|
||||||
- [GNU Make 4.3](https://www.gnu.org/software/make/)
|
- [GNU Make 4.3](https://www.gnu.org/software/make/)
|
||||||
- [goreportcard-cli](https://github.com/gojp/goreportcard)
|
- [goreportcard-cli](https://github.com/gojp/goreportcard)
|
||||||
- [golangci-lint](https://golangci-lint.run/)
|
- [golangci-lint](https://golangci-lint.run/)
|
||||||
|
### Environment Vars
|
||||||
|
As shown in .env.example you have to configure this variables in order to make your binary works right:
|
||||||
|
```.env
|
||||||
|
SCRIPT_BINARY_PATH=/bin/bash
|
||||||
|
WEBHOOK_SCRIPT_PATH=/path/to/mybashscript.sh
|
||||||
|
FILE_TO_WATCH_PATH=/path/to/myfile.txt
|
||||||
|
TEST_FILE_TO_WATCH_PATH=./test_monitor.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
**TEST_FILE_TO_WATCH_PATH** is needed just to run tests
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
### Build
|
||||||
|
To build you can only just `make build` command
|
||||||
|
```bash
|
||||||
|
make build
|
||||||
|
```
|
Loading…
Reference in New Issue