Integrate Git Repository Rapid Deployment Components

This document is suitable for application operation and maintenance personnel who use Kato and GitLab systems at the same time.

The scenario suitable for this document is: Through the demonstration use case, understand how kato and GitLab perform OAuth docking, and realize the rapid deployment of projects in GitLab and the use of Webhooks to realize automatic construction

Prerequisites

Existing GitLab private repository, if it has not been deployed, please refer to the section GitLab Quick Deployment below to deploy

Steps

GitLab can be deployed directly to your Kato environment through the one-click installation method of the application market.

GitLab rapid deployment

Install GitLab application

Running Result

Docking with GitLab OAuth

This session will configure Kato to connect to GitLab type OAuth

Configuration Applications

Go to User Settings -> Applications

Option nameFill in contentDescription
NameKatoFill in the custom Application name
Redirect URIhttps://gridworkz.gridworkz.com/ console/oauth/redirectRedirect path, used to receive the credentials returned by the third-party platform. The public cloud format is https://xxx.gridworkz.com/console/ oauth/redirect uses the privatized deployment format https://IP:7070/console/oauth/redirect
Scopesapi, read_user, read_repositoryGitLab permission settings, need to open api, read_user, read_repository
Kato Platform Certification

Enter Kato homepage enterprise view -> Settings -> OAuth interconnection service -> View settings -> Add

Option nameFill in contentDescription
OAuth typegitlabOauth type of authentication
OAuth TypeCustom (GitLab-Demo)Fill in the custom Oauth service name
Service addresshttp://kato.gitlab/GitLab service access address
Client IDFill in according to specific informationApplication ID generated by GitLab
Client SecretFill in according to specific informationApplication Secret generated by GitLab
Platform access domain nameUse the default to fill in the contentUsed for the access address when the OAuth authentication completes the rebound
OAuth Authentication

Enter Kato homepage enterprise view -> personal center -> OAuth account binding -> Corresponding account -> Go to authentication

Connect to the GitLab Repository and Complete the Automatic Build

Create a GitLab project with the following content
When using privatization to deploy Kato, you need to configure GItLab to allow Webhook requests to be sent to the local network

Enter Admin area -> settings -> NetWork -> Outbound requests

Check the Allow requests to the local network from hooks and services option

Build source code through Kato

Enter Kato team view -> Add -> Create component based on source code -> Correspond to Gitlab project -> Correspond to source code project -> Create component

Enter the build page, select configuration

Visit effect display

Webhook automatic construction display

Modify the index.html file of the GitLab kato-test project, and add the keyword @deploy to the Commit information when submitting

Automatic update effect display

Visit effect display