Issue
- Is there any way to deploy updates for only one Liferay PaaS service at a time? Only a minor configuration change is needed, and it would be helpful to not need to restart all services in the entire Liferay PaaS stack by creating and deploying a full new build.
Environment
- Liferay PaaS
Resolution
- To deploy only specific services within a build, you can configure
"deploy": falsewithin the LCP.json for any services that you would like to exclude from a "low impact" deployment for a specific environment. You would then submit the change via a pull request as normal. - For example, when examining the
liferayservice's default LCP.json, the following is included:
"environments": {If you want to exclude the
"infra": {
"deploy": false}}liferayservice from being deployed to -prd for a build (so that all services deploy exceptliferay), you would add the following before submitting the PR:
"environments": {
"infra": {
"deploy": false
}
"prd": {
"deploy": false
}}
Additional Information
- An additional option for deploying a single service is available using the
lcp deploycommand within the Liferay PaaS Command-line Tool. Full documentation is still being created for this tool, so this option should only be used with caution and at your team's discretion (as it will skip GitHub entirely, you will not be able to see a pull request for this deployment, it may lead to syncing issues if moving back and forth between deployment types, and it will not go through approval processes you may have configured in GitHub).
-
When using the version 3.x.x workspace, to deploy a single service using this command (for example,
webserver), here are the steps:
- Navigate to your Liferay PaaS repository on your local machine
- Add the configuration change you will be implementing
- Run
./gradlew distLiferayCloud - You should now see a build folder
- Navigate to
build/lcp/webserver - Run
lcp deploy(you may need runlcp loginto authenticate first) - Choose the environment you'd like to deploy to
After these steps, a new deployment will have been started for only thewebserver
-
When using the version 4.x.x workspace, to deploy a single service using this command (for example,
webserver; see note aboutliferaybelow), here are the steps:
- Navigate to your Liferay PaaS repository on your local machine
- Add the configuration change you will be implementing
- Navigate in a terminal to the directory of the specific service being deployed, for example:
[repository_home]/webserver - Run
lcp deploy(you may need runlcp loginto authenticate first) - Choose the environment you'd like to deploy to
After these steps, a new deployment will have been started for only thewebserver
-
The exception to this (when using the version 4.x.x workspace) is for the
liferayservice, which has the following steps:
- Navigate to your Liferay PaaS repository on your local machine
- Add the configuration change you will be implementing
- Navigate in a terminal to the liferay directory
[repository_home]/liferay -
Run
./gradlew clean deploy createDockerfile -
Run
cp LCP.json build/docker -
Navigate to
build/docker - Run
lcp deploy(you may need runlcp loginto authenticate first) - Choose the environment you'd like to deploy to
Note: you will see a "Dockerfile does not exist." error if steps 4 or 5 are skipped.
After these steps, a new deployment will have been started for onlyliferay
- More information regarding this topic can be found in the following articles: