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.

  1. 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);

  2. First create a spike group and create a robot, select custom via webhook service

  1. 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

  1. 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

  1. Rancher is not yet available for automatic deployment. Rancher’s API-Webhook service needs to be configured

  1. Add receiver:

 

  1. Rancher configures application service files

 

  1. 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.