Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.
background
Jenkins had already integrated a one-click build package, but deploying the app still required Rancher to manually click the upgrade button to successfully deploy the app and update the service. To solve this problem, Jenkins combined with Rancher spike group notification of successful deployment.
-
First, install applications: Jenkins, Rancher, Dingding and other PC side; Prepare the configuration data, Jenkins installed the nail plug-in and project-related plug-in (mainly docker image construction);
-
First create a spike group and create a robot, select custom via webhook service
- All the way to the next step of adding to finish, copy the notification address and obtain the access_token configuration in Jenkins’ access_token
- Jenkins configured job notification and completed the construction of automatic notification spike group. Jenkins configuration, in dingding2.0 version, Jenkins needs to configure the pin robot in system administration
{" msgType ": "text", "text": {"content": "Android new package, please update apk: update address: "}}; Tips: Try to include keywords in your content
You can actually write it in the Jenkins build configuration because the parameters can be concatenated
- Rancher is not yet available for automatic deployment. Rancher’s API-Webhook service needs to be configured
- Add receiver:
- Rancher configures application service files
- One more step is to configure Jenkins to execute the shell script
9. At this point, you’re done. Decide on the build project branch, and you’re ready to start the happy one-click process of building and deploying application services.