read secret from k8s
This commit is contained in:
parent
da809273e0
commit
b22355d2a5
12 changed files with 583 additions and 85 deletions
56
README.md
56
README.md
|
|
@ -9,28 +9,68 @@ This way we can trigger cleanups when the PR is closed.
|
|||
## Push Event
|
||||
|
||||
```
|
||||
X-Interceptor-Ref: refs/heads/master
|
||||
X-Interceptor-Push-Ref: []string{"refs/heads/master"}
|
||||
```
|
||||
|
||||
Response Headers:
|
||||
|
||||
```
|
||||
Commit: <Head Commit Hash>
|
||||
```
|
||||
|
||||
## Pull-Request Event
|
||||
|
||||
```
|
||||
X-Interceptor-Action: [create|delete]
|
||||
X-Interceptor-Pr-Action: []string{"opened", "reopened", "synchronize", "synchronized"}
|
||||
```
|
||||
|
||||
Response Headers:
|
||||
|
||||
```
|
||||
Issue: <Pull-Request ID>
|
||||
Commit: <Pull-Request Head Commit Hash>
|
||||
```
|
||||
|
||||
## Issue Comment Event
|
||||
|
||||
**TBD**
|
||||
```
|
||||
X-Interceptor-Comment-Action: "/test"
|
||||
```
|
||||
|
||||
### Actions
|
||||
|
||||
TBD:
|
||||
|
||||
* `/label <name>` - add a label `<name>` to the pull request
|
||||
* `/test` - run tests pipeline (requires `test` label)
|
||||
* `/deploy` - deploy pull request in preview environment (requires `deploy` label)
|
||||
|
||||
Response Headers:
|
||||
|
||||
```
|
||||
X-Interceptor-Comment: /test
|
||||
Issue: <Pull-Request ID>
|
||||
Commit: <Pull-Request Head Commit Hash>
|
||||
```
|
||||
|
||||
# Build and run
|
||||
|
||||
```
|
||||
export KO_DOCKER_REPO='gcr.io/my-gcloud-project-name'
|
||||
export GO111MODULE=off
|
||||
Create git authentication secret:
|
||||
|
||||
ko apply -f config/
|
||||
```
|
||||
cat <<EOF>secret.yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: git-auth
|
||||
namespace: webhook-interceptor
|
||||
type: Opaque
|
||||
stringData:
|
||||
github.com: "<username>:<password>"
|
||||
EOF
|
||||
```
|
||||
|
||||
```
|
||||
echo KO_DOCKER_REPO='gcr.io/my-gcloud-project-name' >env.txt
|
||||
|
||||
./build.sh
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue