Jenkins and Kato Docking App

Overview

If you already have your own CI workflow and want to continuously deploy your application in the cloud, this article will guide you to deploy your application to the cloud and set up continuous deployment. Considering that Jenkins is the current mainstream continuous integration tool, and it has been very mature in source code testing and Pipline, we provide an integration solution for Jenkins. Under normal circumstances, after our source code is built and integrated by Jenkins, the output application may be source code format or mirror image. Kato supports application continuous deployment, let’s explain how to connect jenkins and kato to deploy source code and image format applications to the cloud help.

Build your own continuous deployment process

There are a wealth of applications that can be installed and used in the application market of Gridworkz. You can use these applications to build your own workflow. We use GitLab or GitHub open source code repository, Jenkins integration tool and Kato to achieve CI and CD.

Source Code

Let’s take Spring Boot demo as an example, the docking point is jenkins for code detection (which can be implemented using the Sonar plug-in), After the build is completed, put the packaged jar package and required files in the target directory. When kato is built, only the target directory needs to be pulled to automatically deploy the source code.

1. Jenkins Configuration

Plug-ins required for Jenkins installation: System Management –> Plug-in Management –> Related plug-ins needed for installation

Jenkins configuration test project: new task

This step is to put the required files and the packaged jar package in the target directory and push to the code repository. Use API to trigger kato to build automatically.

2.Kato Configuration

Need to have a created source code application

How to use API to trigger automatic build

By opening the API to automatically construct the returned url, the POST method calls the API, and the secret key can trigger the automatic API construction. The secret key can be customized.

API usage:

curl -d'{"secret_key":"<Secret Key>"}' -H "Content-type: application/json" -X POST <API address>

Just add it in the Jenkins build process

Mirror

  • After Jenkins is built, the image will be generated and pushed to DockerHub

  • Create an image format application in Gridworkz

  • Generate a webhook that triggers the mirror repository in the cloud help, and add the webhook to DockerHub, so that DockerHub will call the API every time the mirror is updated