Now that we have created the jobs for both UI's, Easy Franchie UI and Day 2 Operations UI, we can trigger the build manually. What we actually want is that the build is triggered automatically each time when there is a change in the repository. Therefore, we will configure a webhook that reacts on changes.
-
In the overview screen of SAP Continuous Integration and Delivery, choose Repositories.
-
Select your repository.
-
Choose Edit.
-
In the repository edit screen, choose Add.
-
In the Type field, select GitHub.
-
In the Webhook Credential field, select Create Credentials.
-
Enter a name for the credentials
-
Click on Generate and copy the created Secret
-
Choose Save.
In the repository details, choose ... and then choose Webhook Data.
-
Either note down the payload URL leave the window open, as we will need this value for the webhook configuration.
-
Open your repository in GitHub and choose Settings.
-
Choose Hooks and then choose Add webhook.
-
In the Add webhook dialog, fill in the following field:
- Payload URL: use the Payload URL (see the chapter above).
- Contend Type: application/json
- Secret: enter the secret (see chapter above)
-
Choose Add webhook.
In order to test the webhook, you can perform a change in the Easy Franchise application. Let's test it by changing something in the Easy Franchise UI.
Note: Currently the build job is configured to use the same version for every build. This will lead to the problem that after performing below described change it will not be visible on the UI. To overcome that problem please edit the deployment job and change the Container Image Tag to another value e.g. easyfranchise-ui-002.
-
Open the file UserProfile.vue.
-
Change the header H1 from User Profile to User Details.
<h1 class="mt-5 mb-5 text-center">User Details</h1>
-
Open the Easy Franchise application to see if the UI is correctly updated. On the top right corner in the bar, choose the user icon.
-
Verify that the page header is called now User Details.
-
Save the file and push the changes to the repository.
As soon as the changes are pushed, both jobs are triggered automatically. After the job is finished, open the application UI and check if your changes are there.
Note: As we have only changed one of the UIs, it would be unnecessary to trigger both jobs. But as we use one and the same repository and branch for each build job, we cannot prevent that.