Trigger builds
In the previous lab we created a build in Otomi using the blue
repo in Gitea. In this lab we'll create a build for the green
repo and trigger the build based on a webhook.
Create a build in Otomi with Trigger enabled
- In the left menu, click on
Builds
- Click on
Create Build
- Fill in the name
green
for your build - Choose
./Dockerfile
and fill in the repo URL for thegreen
repo created in the previous lab. - Enable
Trigger
- Click
Submit
Get the webhook URL
Before we can configure the webhook for the green
repo in Gitea, we will need the webhook URL. You can find this webhook URL for your build in the list of Builds. Add the webhook URL to your clipboard.
Create a Webhook
- In Otomi Console, click on
apps
the left menu and then openGitea
- In the top menu of Gitea, click on
Explore
and then on thegreen
repo - Go to
Settings
(top right) and then toWebhooks
- Click
Add Webhook
and selectGitea
- In the
Target URL
, paste the webhook URL from your clipboard. - Click
Add Webhook
Trigger the build
You can now trigger the build by doing a commit in the green
repo, or by testing the webhook. Let's test the webhook:
- In Gitea, go to the
Settings
(top right) of thegreen
repo and then toWebhooks
- Click on the webhook we just created
- In the bottom, click on
Test Delivery
Check the status of the build
The build should now have started. Based on the webhook, Tekton has now created a PipelineRun
. Let's check the status of the PipelineRun:
- In Otomi Console, click on
Builds
- In the list of Builds, click on the
PipelineRun
link of thegreen
build - Tekton Dashboard will open and show a list of all the PipelineRuns
- Click on the PipelineRun with the name
docker-trigger-build-green-*
- You can now see the status of the build
Find your image in Harbor
The build succeeded. Now it is time to see artifacts
- In Otomi Console, got to Apps and click on
Harbor
- Click
LOGIN VIA OIDC PROVIDER
- Navigate to the
team-demo
project - In the
Repositories
tab, clickteam-demo/blue
link - Observe artifacts