April 17, 2020
Estimated Post Reading Time ~

How to build and deploy the code to DEV and QA environment from your local?

If your build process is part of a larger development lifecycle management setup, such as a continuous integration process, you often need to deploy to other machines than just the developer's local instance. In that scenario, we need to update the <properties> in global POM.XML 

Approach 1:
Before:
<properties>
    <aem.host>localhost</aem.host>
    <aem.port>4502</aem.port>
    <aem.publish.host>localhost</aem.publish.host>
    <aem.publish.port>4503</aem.publish.port>
    <sling.user>admin</sling.user>
    <sling.password>admin</sling.password>
    <vault.user>admin</vault.user>
    <vault.password>admin</vault.password>
    <powermock.version>1.7.4</powermock.version>
</properties>

After:
<properties>
    <aem.host><your AEM development author server URL></aem.host>
    <aem.port>4502</aem.port>
    <aem.publish.host>your AEM development publish server URL</aem.publish.host>
    <aem.publish.port>4503</aem.publish.port>
    <sling.user>server user ID</sling.user>
    <sling.password>server password</sling.password>
    <vault.user>server user ID</vault.user>
    <vault.password>server password</vault.password>
    <powermock.version>1.7.4</powermock.version>
</properties>

Approach 2:
How-To Work with Deployment Profiles

If your build process is part of a larger development lifecycle management setup, such as a continuous integration process, you often need to deploy to other machines than just the developer's local instance.
For such scenarios, you can easily add new Maven Build Profiles to the project's POM.

The example below adds a profile integrationServer, which redefines the host names and ports for the author and publish instances. You can deploy to these servers by running maven from the project root as shown below.

#install on integration test author
$ mvn - PautoInstallPackage - PintegrationServer install

# install on integration test publisher
$ mvn - PautoInstallPackagePublish - PintegrationServer install

myproject/pom.xml

<profiles>
    <!-- ... -->
    <profile>
        <id>integrationServer</id>
        <properties>
            <crx.host>your AEM development author server URL</crx.host>
            <crx.port>4502</crx.port>
            <publish.crx.host>your AEM development publish server URL</publish.crx.host>
            <publish.crx.port>4503</publish.crx.port>
        </properties>
    </profile>
</profiles>


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.