We can migrate our Catalyst project from the Bitbucket Repository to the Catalyst deployment environment using the CI/CD pipeline.
Pre-requisites:
Before setting up make sure you have the following data for your catalyst project
catalyst token
Catalyst project name
Catalyst Project Org ID
To know how to set up a catalyst project, you can try this tutorial on a simple web application.
You need to generate a CLI token for executing commands for your user account from Catalyst CLI by executing the following command:
This will initiate the token generation process. The CLI will display a URL that you can visit from any device. It will also generate a device verification code, which you must enter on the web page of the URL.
Navigate to the URL displayed in the CLI and enter the verification code. Click Verify. The code will only be valid for five minutes.
Once your device's CLI is verified, the token will be generated and displayed in your CLI.Do make a copy of that token.
You can find your Catalyst Project name and Catalyst Org ID from the Catalyst Console Homepage: "https://console.catalyst.zoho.com/baas/{OrgID}/index"
CI/CD Setup:
Navigate to the main branch of your Bitbucket repository where you stored your Catalyst project and create a called bitbucket-pipelines.yml which contains the script code to run in CI/CD pipeline.
To know more about the Bitbucket CI/CD pipeline kindly refer here.
After setting up the runners based on your preference you need to paste the below code based on the type of functions your catalyst application is going to run on.
bitbucket-pipelines.yml
Before committing any changes you need to add the below Values in your repository variables. You can find the help documentation for the same here.
CATALYST_PROJECT_NAME - Your Project Name
CATALYST_ORG - Your Project Org ID
CATALYST_TOKEN - Your catalyst token generated using the command catalyst token:generate
After pasting the above-mentioned code snippet in your bitbucket-pipelines.yml file, once you do a commit, the CI/CD pipeline executes the job mentioned in the bitbucket-pipelines.yml file.