In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you the relevant knowledge points about the method of automatic construction and deployment of Rainbond configuration components. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
Preface
Through the automatic build function, you can automatically trigger the construction and deployment of components after the code or image is submitted. Rainbond provides three ways to trigger the automatic deployment of components based on code repository Webhooks, image repository Webhooks and custom API. The automatic build function can help developers to realize agile development easily.
prerequisite
Components are created by source code (except official demo) and can support code repository Webhooks. Currently, code repositories are supported by GitHub, GitLab, Gitee and Gogs.
Components are created by images and can support image repositories Webhooks. Currently, Docker official repositories and Aliyun image repositories are supported.
Create component A from the source code and keep it in a normal running state.
Based on the source code operation flow 1. Open component Git-Webhook
In the component management panel / build source management, turn on the Git-Webhook automatic build function to copy the generated hook address.
The deployment action is performed by default after the automatic build of Rainbond, so developers generally do not want to deploy the action every time the code is submitted. Therefore, Rainbond hook automatic trigger sets the premise and triggers the action only when the @ keyword is included in the Commit information. This keyword can be set by the developer.
Please note that the domain name generated here is generated based on the domain name of the current access platform. If it is incorrect, you can directly use the correct access domain name of the platform.
two。 Configure the code repository
If your project is stored in Github, please refer to the following screenshot:
If your project is stored in Gitlab, please refer to the following screenshot:
Other code repositories are configured in a similar way. It should be noted that currently, Rainbond hook trigger does not support security request verification.
Based on the operation flow of image warehouse
The automatic construction of the image warehouse can realize the automatic construction of the application after pushing the image, and it is convenient to interface with the third-party automation process. Automatic build is triggered when the following conditions are determined when the mirror update event arrives.
The application is created by images, and the image repository is Docker Hub. Aliyun image repository is supported in version 5.1.2 and later.
Whether the updated image name and tag by default are the same as the source image name of the current component (the domain name of the image repository is not included when judging). Version 5.1.3 and later supports configuring Tag to trigger regular policy to dynamically match and change the component's image Tag.
The component has enabled the image repository Webhook function.
The application status is not closed.
1. Enable automatic construction of image repository Webhook
The automatic build feature needs to be enabled in the application, and the webhooks url of the application needs to be configured to the webhooks of the target image repository.
2.Tag triggers automatic policy modification
By default, the image name and Tag of the Webhook update event must be consistent with the image name and Tag configuration of the component's current build source to trigger build and deployment. After configuring the Tag trigger policy, according to the configured regular expression, if the mirror tag of the received push event correctly matches the regular expression, the update event is considered to be valid, and the build source information of the current component is upgraded and built automatically according to the updated Tag information.
For example, setting the Tag policy to: v5.* will be allowed when Tag is v5.1 v5.2 v5.9, etc.
3. Configure the image repository
Configure Docker Hub
For the configuration method, please refer to the following screenshot:
API triggers automatic build
By enabling the url,POST method call API returned by API automatic construction, you can trigger API automatic construction with the secret key, which can be customized.
API is used as follows:
Curl-d'{"secret_key": ""}'- H "Content-type: application/json"-X POST
Triggering automatic builds based on API is one of the most flexible ways to integrate with third-party CI systems.
These are all the contents of the article "how to automatically build and deploy Rainbond configuration components". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.