Small little cicd helper that can forward harbor webhooks to restart deployments on kthcloud
by wrapping the kthcloud
api.
Tutorial
-
Head over to your project on the kthcloud harbor registry
-
Click
Webhooks
-
Click
NEW WEBHOOK
-
Choose a name for the webhook
-
Deselect all
Event Type
s exceptArtifact pushed
-
Add
https://cicd.app.cloud.cbh.kth.se/harbor/restart
as theEndpoint URL
-
Add your kthcloud api token as
Auth Header
-
It should look like this:
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>"
- Docker
- Docker buildx extension
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
- go
- make
You can build it to a binary using the following command
make
Note: must be ran in the root directory of this repo
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 |