Skip to content

Small little cicd helper that can forward harbor webhooks to restart deployments on kthcloud by wrapping the kthcloud api.

License

Notifications You must be signed in to change notification settings

Phillezi/cicd-helper

Repository files navigation

cicd-helper

Small little cicd helper that can forward harbor webhooks to restart deployments on kthcloud by wrapping the kthcloud api.

Usage (of existing deployment)

Automatically restart all your images that use the image that has been updated on a harbor project

Tutorial

  1. Head over to your project on the kthcloud harbor registry

  2. Click Webhooks

  3. Click NEW WEBHOOK

  4. Choose a name for the webhook

  5. Deselect all Event Types except Artifact pushed

  6. Add https://cicd.app.cloud.cbh.kth.se/harbor/restart as the Endpoint URL

  7. Add your kthcloud api token as Auth Header

  8. It should look like this:

    image

Manually specifying image

The following command will restart the deployment with the <deployment-id-here>

curl -X POST  https://cicd.app.cloud.cbh.kth.se/forward?deploymentid=<deployment-id-here> \
  -H "Content-Type: application/json" -H "Authorization: <kthcloud-api-token-here>"

Usage (setting up own deployment)

Build the dockerfile

Prerequisites for building docker image

  • Docker
  • Docker buildx extension

Command

You can build the Docker image using the following command

docker buildx build --file Dockerfile --tag cicd-helper:latest .

Note: must be ran in the root directory of this repo

Build a binary

Prerequisites for building a binary

  • go
  • make

Command

You can build it to a binary using the following command

make

Note: must be ran in the root directory of this repo

Configuration

Name Description Default
PORT Set the port to use 8080
API_URL Set the base url of the api to use https://api.cloud.cbh.kth.se

About

Small little cicd helper that can forward harbor webhooks to restart deployments on kthcloud by wrapping the kthcloud api.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published