Deploying and Promoting to Production

As Kyle begins to work on development with Liferay Cloud, he goes through his first full deployment process by deploying and promoting a simple widget module.

Here, you’ll deploy and test an example widget to walk through the whole process.

Pushing Up New Code

Download an example module with a new, simple widget to deploy to your Liferay Cloud environment for these steps.

  1. Open a command prompt within your project repository’s liferay/ directory.

  2. Download and unzip the example’s source code into a modules/ folder.

    curl https://resources.learn.liferay.com/courses/latest/en/cloud-administrator/cloud-development-lifecycle/liferay-e3v7.zip -O
    
    unzip liferay-e3v7.zip -d modules/
    
  3. Commit and push the source code to your remote repository on GitHub.

    git add modules
    
    git commit -m "Add a simple module to push to production."
    
    git push origin [branch_name]
    

Your infra environment creates a new build from your push that you can deploy from the Liferay Cloud console once it’s complete.

Deploying to UAT

Next, deploy the build to your UAT environment for testing.

note

Whether you deploy to UAT or another dev environment depends on your subscription and your own workflow. Once you configure automatic deployment, you can skip manually deploying to the first environment in the process.

  1. In the Liferay Cloud console, click Builds at the top of the screen.

  2. Find the new build from your push and click Deploy build to…

    Find your build on the Builds page and deploy it to UAT.

  3. From the Environment drop-down menu, select your UAT environment.

  4. Click the checkboxes to confirm the impact of the deployment.

    The Deploy Build button appears when you have selected an environment and clicked the checkboxes.

  5. Click Deploy Build.

Your UAT environment’s services restart, and once they are back up, the example module is deployed to the Liferay instance.

Accessing Your UAT Environment

Next, manually test the new widget to ensure it’s working correctly.

  1. Navigate to your infra environment.

  2. Click Settings on the left side of the screen.

  3. Select the Secrets tab.

  4. Click the lcp-secret-ci-customer-user secret.

    The lcp-secret-ci-customer-user secret has the username needed to access your UAT instance.

  5. Click View to confirm the secret value you need to log into your UAT instance.

    Click View to view and confirm the secret value.

    tip

    The default username is customer.

  6. Click the back arrow to return to the list of secrets.

  7. Click the lcp-secret-ci-customer-password secret.

  8. Click View to see the secret value. You can click the value itself to copy it to your clipboard.

  9. Navigate to your UAT environment.

  10. Click Visit Site at the top of the page.

  11. When prompted for credentials, enter the username and password you found from the lcp-secret-ci-customer-user and lcp-secret-ci-customer-password secrets, respectively.

Now you have successfully logged in and accessed your UAT Liferay instance.

Acceptance Testing

Next, test the new widget to make sure it’s working properly.

  1. Log in as the default administrator.

  2. Click the edit icon ( edit icon ) at the top of the page to access a list of widgets.

  3. From the Fragments and Widgets sidebar, click the Widgets tab.

  4. Scroll down and expand the Sample section to find the new widget, E3V7 Widget.

    The E3V7 Widget is the new widget from the example module you added.

  5. Drag it anywhere on the page to see how it looks. The example widget displays simple text.

Now that you’ve confirmed the widget is working, continue to promote the build to production.

Deploying to Production

Kyle needs to get approval from his manager, Marcus, before he can promote the build to production. Once it’s approved, he can deploy the same build to production during a planned period of downtime.

Deploy the build to production now that it’s passed your testing process.

  1. In the Liferay Cloud console, click Builds.

  2. Using the same build as before from the list, click Deploy build to…

  3. Under the Environment drop-down menu, select your production environment.

  4. Click the checkboxes to confirm the impact of the deployment.

  5. Click Deploy Build.

The production environment’s services restart with the new addition from the build. Once the services are back up, you can visit your production environment’s Liferay instance to see the new widget appear there, too.

Next: configure automatic deployment to speed up the development workflow.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy