Aperio DevPack (legacy)
Aperio Development Pack for DC1 is a set of components and tools to help you develop Aperio mobile apps for DC1. Not used any more.
It includes:
- API Tool to test your API requests and to generate mobile apps
- AperioClient to run your mobile apps for testing
This development pack is built as a Docker image and is accessible from this project image registry.
How to use the development pack with my mobile apps?
Prerequisites
Have the mobile apps you want to work with cloned in a local folder, e.g. “C:\MobileAppsDev\dc1_12”
- Note: the apps should have develop.json file present describing its development profile (e.g. default DC1 company)
Docker desktop app installed
- Important: for proper operation of File watcher (JForms), the following property needs to be turned off in Docker settings: “Use the WSL 2 based engine” (OFF).
- Note: if the file watcher still does not work - try restaring your PC.
- Docker settings -> Resources -> File sharing
- add the root folder of your Mobile Apps, so the Docker container will have access to the folder and the API Tool will be able to generate Mobile Apps there.
- Important: for proper operation of File watcher (JForms), the following property needs to be turned off in Docker settings: “Use the WSL 2 based engine” (OFF).
To pull the Docker image you need to be logged-in to the Git repository. Login with this command:
To check if you are logged in, use ‘git config -l’ command and look for user.name and user.email properties.
Starting the container
To start AperioDevPack, run docker command with environment variables that define your Mobile Apps development environment and API connection. You can run your command directly or using a script.
Note: If you prefer to have the command in a startup script, you can use the examples from this project. See Configure the startup script paragraph further down.
Direct command
Follow these steps to run the dev pack:
Prepare the following command to run the development pack as Docker container:
In the command, set the following 5 variables:
API_ADDRESS
It points to API Bridge that is configured to serve API for a DC1 version. See internal iptor infrastructure to discover API Bridges addresses.
aperio.apps
The list of mobile app names that will be enabled for development. They should exist in the local folder provided in –mount/src attribute. Example:
Note: do not put spaces between the app names.
aperio.default.user.name
User profile name for API Tool to load the metadata when generating app forms.
aperio.default.user.password
User password for the profile above.
src
The path to your local folder with mobile apps (src).The API tool will use this folder to find mobile apps for development. The list of apps to look for is taken from aperio.apps variable. Example:
Run the command in the command prompt (terminal).
- When running for the first time, the command will download the image from the Git project’s repository. It may take some time and you may be required to provide your Git credentials to login
- to login to GitLab use the following command:
- When the container is starting up:
- Docker may ask for permission to share the folder - allow it to give Docker access to your mobile apps folder (see Prerequisites).
- the command window will log some information about the apps and their properties. After a succesfull start, among other lines, there should be the following statements displayed:
- [APP] 20230222 10:09:38 INFO AperioClient started.
- [TOOL] 20230222 10:09:39 INFO Aperio API Tool started
- When running for the first time, the command will download the image from the Git project’s repository. It may take some time and you may be required to provide your Git credentials to login
Run & test
When the development pack container is running, use the following links to start:
API Tool: http://localhost:8080/aperio/tool
Mobile app: http://localhost:8080/aperio/app?name=[app-name]&develop=true
Example to run MobileWarehouse in develop mode:
http://localhost:8080/aperio/app?name=mwhs-dc1_12&develop=true
Test API Bridge, using the readiness end-point: http://<api_server:port>/health/readiness
Example: :9091/health/readiness
When working with jforms
To verify that the JFroms generation works fine, check the container console. After changing a jform, the console should display the messages about processing the jform. Example, assuming that we have just changed jform “nurfBalancesEnquiry.json”:
- [TOOL] 20230221 08:25:17 INFO Processing form: nurfBalancesEnquiry …
- [TOOL] 20230221 08:25:19 INFO Form processed: nurfBalancesEnquiry
Note: The errors/warning that occurs during generation are printed out to /log folder of the jforms folder.
Stopping the container
In the console, press Ctrl-C to stop the container. You can stop the container also in the Docker deskop app. In the desktop app you can also inspect all the settings, logs and remove unused containers.
Configure the startup script (optional)
There are 2 example scripts in the project:
- start.bat - for Windows command prompt
- start.sh - for Linux/bash
Configure the following properties (the same that the command uses):
API_BRIDGE
It points to API Bridge that is configured to serve API for a DC1 version.
APPS_PATH
The path to your local folder with mobile apps
The API tool will use this folder to find mobile apps to develop. The list of apps to look for is provided in APPS property. Example:
APPS - The list of mobile app names that will be enabled for development. They should exist in the local folder provided in APPS_PATH. Example:
Note: do not put spaces between the app names.
Default user profile - credential used by API Tool to login to the system to load the metadata used when generating mobile app forms.
- USER - default user name
- PWD - default user name password
Note: you can use muliple startup scripts to run the dev pack with different settings.
How to build image & push it to the container registry? (for project maintainers)
When comtting changes to the repository the pipeline automaticaly is created to build a new image. Check CI/CD of the project.