Skip to main content

Integrate Git repositories with rapid deployment components

This document is suitable for application operation and maintenance personnel1 who use and GitLab systems **the same time.

This document is suitable for the scenario:Through the demonstration use case, understand how rainbond connects with GitLab for OAuth, and realize the rapid deployment of projects in GitLab and the use of Webhook to achieve automatic construction

Preconditions

  • If the existing GitLab private repository has not been deployed, you can refer to the following section GitLab Quick Deploymentto deploy it

Steps

GitLab can be deployed directly into your Rainbond environment through one-click installation from the App Market.

GitLab Rapid Deployment

  • Install the GitLab app

    image-20200515143803028

  • running result

    image-20200515164633334

Connect to GitLab-type OAuth

This section will configure Rainbond to connect to GitLab type OAuth

  • Configure Applications

    Go to User Settings → Applications

option nameFill in the contentillustrate
NameRainbondFill in the custom Application name
Redirect URIhttps://goodrain.goodrain.com/console/oauth/redirectThe fallback path is used to receive the credentials returned by the third-party platform. The public cloud format is https://xxx.goodrain.com/console/oauth/redirect The private deployment format is https://IP:7070/console/oauth /redirect
Scopesapi, read_user, read_repositoryGitLab permission settings, you need to open api, read_user, read_repository
  • Rainbond Platform Certification

    Enter Rainbond Homepage Enterprise View→ Settings→ OAuth Interconnection Service→ View Settings→ Add

option nameFill in the contentillustrate
OAuth typegitlabOauth type for authentication
OAuth typeCustom (GitLab-Demo)Fill in the custom Oauth service name
service addresshttps://rainbond.gitlab/GitLab service access address
Client IDFill in with specific informationApplication ID generated by GitLab
client secretFill in with specific informationApplication Secret generated by GitLab
Platform access domain nameUse default fillThe access address used for the bounce back after OAuth authentication
  • OAuth authentication

    Enter Rainbond Homepage Enterprise View → Personal Center → OAuth Account Binding → Corresponding Account → Go to Authentication

Dock GitLab repository and complete automatic build

  • Create a GitLab project with the following content

    image-20200518113119649

  • When deploying Rainbond using privatization, you need to configure GItLab to allow sending webhook requests to the local network

    Go to Admin area → settings → NetWork → Outbound requests

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

  • Build from source with Rainbond

    Enter the Rainbond team view → Add → Create components based on source code → Corresponding Gitlab project → Corresponding source code project → Create component

    image-20200518112657470

    Go to the build page and select configure

    image-20200519142235426

    Visit the performance display

    image-20200518114603719

  • Webhook automatically builds presentations

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

    image-20200518132824057

    Automatic update effect display

    image-20200518133118625

    Visit the performance display

    image-20200518132745969