No description
  • Go 95.7%
  • Dockerfile 2.3%
  • Shell 2%
Find a file
2019-12-04 17:42:30 +01:00
config read secret from k8s 2019-12-04 17:42:30 +01:00
.gitignore read secret from k8s 2019-12-04 17:42:30 +01:00
.ko.yaml read secret from k8s 2019-12-04 17:42:30 +01:00
build.sh read secret from k8s 2019-12-04 17:42:30 +01:00
Dockerfile first commit 2019-11-30 12:09:41 +01:00
go.mod read secret from k8s 2019-12-04 17:42:30 +01:00
go.sum read secret from k8s 2019-12-04 17:42:30 +01:00
helper.go read secret from k8s 2019-12-04 17:42:30 +01:00
LICENSE first commit 2019-11-30 12:09:41 +01:00
main.go read secret from k8s 2019-12-04 17:42:30 +01:00
README.md read secret from k8s 2019-12-04 17:42:30 +01:00
types.go read secret from k8s 2019-12-04 17:42:30 +01:00

webhook-interceptor

The Webhook Interceptor checks for specific conditions when a webhook is received.

This way we can trigger cleanups when the PR is closed.

HTTP Headers

Push Event

X-Interceptor-Push-Ref: []string{"refs/heads/master"}

Response Headers:

Commit: <Head Commit Hash>

Pull-Request Event

X-Interceptor-Pr-Action: []string{"opened", "reopened", "synchronize", "synchronized"}

Response Headers:

Issue: <Pull-Request ID>
Commit: <Pull-Request Head Commit Hash>

Issue Comment Event

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:

Issue: <Pull-Request ID>
Commit: <Pull-Request Head Commit Hash>

Build and run

Create git authentication secret:

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