Enabling Auto Deployment with Kloudbean CI/CD.

Traditionally, when a developer pushes code to a repository, manually triggering the build process, creating builds, and uploading artifacts to the host server can be time-consuming and repetitive. Continuous Deployment eliminates these bottlenecks by automating the entire deployment pipeline, triggering the deployment process automatically based on specific events in your Git repository.

With Kloudbean's CI/CD feature, this process becomes even more efficient and convenient. Once enabled, Kloudbean automatically deploys your application to the server whenever changes are detected in your codebase. This eliminates the need for manual interventions, saving time and reducing errors, allowing developers to focus on building features and improving the application.

In this knowledge base, we will walk you through the simple steps to enable CI/CD for your app hosted on Kloudbean, helping you streamline your deployment process and adopt a faster, more reliable workflow.

Step 1: Enabling CI/CD feature from Kloudbean console.

In order to enable CICD, make sure your git repo is connected, until then you won't be able to enable continuous deployment.

If you git repo is connected, scroll down to CICD deployment trigger section and turn On the toggle to enable this feature.

Demonstration on enabling Continuous Deployment.
Demonstration on enabling Continuous Deployment.

Once you enable it, there will following fields appear in this section.

  1. Webhook url: This is the webhook url you will have to add in respective code repository that you are using for your app (Github, Gitblab, Bitbucket).
  2. Secret Token: This is the token that will be used for authentication. You can renew token on demand basis, but if u renew then make to update it in your repo webhook settings as well, as kloudbean will authenticate webhook request on the basis of secret send.
Demonstration on getting Webhook URL and Secret token.
Demonstration on getting Webhook URL and Secret token.

Step 2: Adding Webhook on respective Git management platforms

Enabling CI/CD using webhook is a simple and easiest process where you will create a webhook on your repository and select the events where you want deployment to be triggered and deployed on production or staging environment. Adding webhook involving same steps on all Git repository management platform like Github, Gitlab and Bitbucket.

Enabling CICD on Github

In order to enable webhook in Github, consider following these steps;

Go to settings section in your desired repository which is connected in kloudbean app using deploy code with Git feature.

Demonstration on accessing webhook tab on Github.
Demonstration on accessing webhook tab on Github.

On left side, click on Webhooks tab, followed by Add webhook button.

Demonstration on adding new webhook in Github.
Demonstration on adding new webhook in Github.

After this, section will appear where you will add required webook information.

  1. Add webhook url in Payload URL field.
  2. Content type select application/json.
  3. In Secret field, add the secret token.
  4. Select the event type where you wished to trigger new deployment on kloudbean site for your respective app.
  5. Click on Add webhook button to save this webhook.
Demonstration on adding webhook URL, Content type and Secret in Github.
Demonstration on adding webhook URL, Content type and Secret in Github.

Once webhook is created, you can click on this webhook to manage or test it. and from the response section, you should be receiving response code 200. If any other response code received that mean webhook is not configured correctly, if you see 403 it mean your secret token is not being authenticated, consider updating webhook with correct Secret.

Demonstration on testing newly created webhook in Github.
Demonstration on testing newly created webhook in Github.

You can view  webhook triggered detail and deployment detail that just initiated after adding webhook in from kloudbean console.

Demonstration on viewing deployment started in kloudbean upon webhook triggered.
Demonstration on viewing deployment started in kloudbean upon webhook triggered.

Enabling CICD on Gitlab

In order to enable webhook in Gitlab, consider following these steps;

Select you repository then click on Webhook tab in the left section. Followed by Add new webhook button.

Demonstration on adding new webhook in Gitlab.
Demonstration on adding new webhook in Gitlab.

After this adding new webhook section will appear, where you are going to add following webhook details.

Insert webhook url in URL field.

Demonstration on adding webhook URL in Gitlab.
Demonstration on adding webhook URL in Gitlab.

Insert Secret token in the Secret token field.

Select the events type on which you wish to trigger the deployment process.

Demonstration on adding webhook Secret and Trigger events in Gitlab.
Demonstration on adding webhook Secret and Trigger events in Gitlab.

SSL verification should b turn on in order to securely trigger deployment process.

Click on Add webhook button to save this newly created webhook.

Demonstration on enabling webhook SSL verification and saving changes.
Demonstration on enabling webhook SSL verification and saving changes.

Enabling CICD on Bitbucket

In order to enable webhook trigger on Bitbucket.

  1. Click on your code repository in Bitbucket.
  2. Go to the tab Repository settings.
  3. Once you are in repository settings, Click on Webhooks tab.
Demonstration on Adding new webhook in Bitbucket.
Demonstration on Adding new webhook in Bitbucket.

After this Add new webhook section will appear, where you are going to add following fields data from kloudbean CI/CD deployment trigger section.

  1. Add webhook name or title in Title section.
  2. Insert webhook in URL field. This url is unique for each app.
  3. Insert secret token in Secret field. This secret is important in order to authenticate legitimate request on kloudbean side, when webhook is triggered.
  4. From Status section, you have to keep status Active.
Demonstration on adding webhook Title, URL and Secret.
Demonstration on adding webhook Title, URL and Secret.

Scroll down to Triggers section where you will see all possible trigger points upon which you want your deployment to initiate. You can select desired event, in case of production trigger mostly set upon merge to main branch or after approval of merge. In this example i selected Push, Approved and Changes Request created event for demo purpose.

Demonstration on setting triggers and saving changes.
Demonstration on setting triggers and saving changes.

Once triggered are adjusted, just hit Save button to create and save this webhook.

Conclusion

Kloudbean streamlines your CI/CD pipeline, making deployment faster, simpler, and more reliable. With automated builds, tests, and seamless integration, your development cycle is optimized for efficiency and speed. Say goodbye to manual deployments and hello to a hassle-free process that ensures your application is always production-ready. Start using Kloudbean’s CI/CD feature today and accelerate your development workflow!

If you encounter any issues while setting up or managing your CI/CD pipeline on the Kloudbean platform, our expert DevOps support team is available 24/7 to assist you.

Was this article helpful?

Connecting Git for code deployment
Enabling SSH Access with an Isolated Application User on Server