Jenkins CI

    From KubeVela 1.2, provides webhook triggers for applications to use. Only a simple curl command in Jenkins pipeline is needed to bridge CI and CD systems.

    In this section, we will demonstrate how to integrate KubeVela with Jenkins in details.

    Prerequisite

    The following requirements are needed to be ensured before starting this tutorial

    • KubeVela v1.2.0+ with VelaUX installed.
    • VelaUX can be accessed by Jenkins. (If KubeVela is installed in an offline environment, you need to check this condition.)

    Setup Webhook Trigger for Jenkins

    In the application view, we can see a default trigger as below

    alt

    To use the webhook in Jenkins, we can paste the Curl Command in either Jenkins Freestyle project or Pipeline project.

    • In Freestyle project, click Add Build Step and select Execute Shell. Copy the Curl Command above into it.
    • In Pipeline projetct, similarly copy the Curl Command and wraps it with a command like the code below

    Now when jenkins execute these build steps, it will notify KubeVela to execute the application workflow automatically.

    Advanced: Secure your Webhook URL

    The KubeVela webhook url in Jenkins can be secured by storing it in Jenkins credentials, instead of directly referring it in the project. You can set up a secret text type credential in Jenkins and use it in the project.