Automatically Deploying CI Service Builds
With Liferay PaaS, you can use webhooks to automatically trigger Jenkins builds for changes pushed or merged to your project’s Git repository (e.g., GitHub, Bitbucket, GitLab, Azure DevOps). These builds can then be manually deployed to project environments via the Liferay Cloud Console. Alternatively, you can speed up the deployment process by configuring the CI service to automatically deploy successful builds from a specific branch to a specified environment.
By default, automatic deployment is controlled by the LCP_CI_DEPLOY_BRANCH and LCP_CI_DEPLOY_TARGET variables. Together they determine which branch is used to trigger automatic deployments as well as the environment to which the builds are automatically deployed. Their default values are set to develop and dev respectively.
If desired, you can configure automatic deployment by editing the LCP_CI_DEPLOY_BRANCH and LCP_CI_DEPLOY_TARGET variables via the Liferay Cloud Console:
-
Navigate to the
infraenvironment for your Liferay Cloud project to see its environment variables.
-
Add the following variables to the CI service:
-
Key:
LCP_CI_DEPLOY_BRANCHValue: enter the desired branch name (e.g.,
useracceptance). -
Key:
LCP_CI_DEPLOY_TARGETValue: enter the desired environment name (e.g.,
uat).
-
-
Click on Save Changes. This causes the CI service to restart with the new variables.
Once restarted, any changes pushed or merged to your specified branch are automatically built and deployed to the target environment.