How to automate app and bundle deployment

When running in remote project mode, it is easy to upload the bundles and apps of your map.apps for Developers project with a single command. This guide demonstrates how to set up the configuration and run the automated bundle and app deployment.

You always have the option to manually upload your bundle to map.apps by executing a compressed build and uploading your bundle via the map.apps Manager as described in Getting started.

Checklist

To follow this guide, you need:
  • map.apps for Developers set up to run in remote project mode. Check Using remote project mode if unsure.

  • map.apps user account with administrative privileges (user must be assigned to role maAdmin).

Step 1: Set the access credentials

Automated deployment is implemented using the mapapps-maven-plugin and the ct-jsregistry-maven-plugin in map.apps for Developers. You need to specify access credentials that allow the plugins to access the map.apps backend service in order to upload files.

Whether you have to provide the access credentials as username and password or as an access token, depends on the security mode activated on the the remote map.apps instance. If security.mode=IDENTITY is set, i.e. you need to authenticate at an external identity provider, you need to specify an access token. If it is set to security.mode=INTEGRATED, or not set at all, you need to specify username and password.

In both cases the authenticated user must have the maAdmin role, that is, they have to be a map.apps administrator.

Option 1: Username and password

  1. Open the pom.xml of your map.apps for Developers project.

  2. Search for the following property declarations:

    <mapapps.user><!-- Set username for map.apps remote installation--></mapapps.user>
    <mapapps.pw><!-- Set password for map.apps remote installation--></mapapps.pw>
  3. Remove the comments and set the value of the properties mapapps.user and mapapps.pw to match the username and password of the map.apps user.

  4. Save the file.

Option 2: Access token

  1. Open the pom.xml of your map.apps for Developers project.

  2. Search for the following property declaration:

    <mapapps.token><!-- Set token for map.apps remote installation--></mapapps.token>
  3. Remove the comment and change the value of the mapapps.token property to match an access token generated at the identity provider.

  4. Save the file.

Step 2: Decide if apps should be uploaded

You can also disable the upload of all apps, so only the bundles get uploaded.

To disable app upload:

  1. Open the pom.xml of your map.apps for Developers project.

  2. Search for the following property declaration:

    <skip.apps.upload>false</skip.apps.upload>
  3. Change the value of the skip.apps.upload property from false to true.

  4. Save the file.

Step 3: Deploy bundles and apps

Now you can use a Maven command to build, compress and eventually deploy your bundles (and apps):

Execute the following command in a terminal in the map.apps for Developers project root folder:

mvn package -P compress,upload

After the command finished successfully, you will find the bundles and the app in the remote map.apps Manager.