- Maximo Application Suite v9.0.x
- Maximo Application Suite v9.1.x
This document provides an overview and explanation of the bitbucket-pipelines.yaml configuration file used for setting up CI/CD pipelines in Bitbucket.
image: atlassian/default-image:latestSpecifies the Docker image to be used for the pipeline. In this case, it uses the default Atlassian image.
services:
docker:
memory: 12288Defines the services required for the pipeline. Here, Docker is used with a memory allocation of 12288 MB.
This step is used for publishing the mobile application.
- step: &publish-step
name: Mobile App Publish
size: 4x
max-time: 20
script:
- apt-get update && apt-get install -y jq
- chmod +x ./mobile-app-publish.sh
- ./mobile-app-publish.sh $APP_ID $ENTITLEMENT_KEY $ENVIRONMENT_URL $API_KEY $MAFTOOLS_VERSION
services:
- docker- Docker: The Docker service is used in the pipeline.
Custom pipeline step is used for publishing the mobile application to the dev/test/prod environments.
Example step for PROD:
mobile-publish-prod:
- variables:
- name: APP_ID
default: "TECHMOBILE"
allowed-values:
- "TECHMOBILE"
- "SRMOBILE"
- "INSPECTION"
- "IRMOBILE"
- step:
<<: *publish-step
deployment: PRODThis script automates the process of publishing a mobile application to the Maximo Manage server using the Maximo Application Framework (MAF) tools.
./mobile-app-publish.sh <appid> <entitlementkey> <environment> <apikey> <maftoolversion>appid: The ID of the mobile application to be published.entitlementkey: IBM entitlement key for accessing the IBM Cloud Registry.environment: The target environment URL.apikey: API key for authentication.maftoolversion: Version of the MAF tools to be used.
GRAPHITE_RELEASE: Reduces the size of the application package (default: 1).NODE_TLS_REJECT_UNAUTHORIZED: Bypasses system checks for a valid security certificate in development or demonstration environments (default: 0).
- Login to IBM Cloud Registry: Authenticates using the provided entitlement key.
- Pull MAF Tools Image: Downloads the specified version of the MAF tools Docker image.
- Create Workspace: Sets up a temporary workspace for the MAF tools.
- Create and Start Container: Runs the MAF tools container.
- Authorize: Authenticates with the MAF tools server.
- Get Application Definition: Retrieves the application definition and sets up the workspace.
- Copy Files: Copies the custom mobile application files to the workspace.
- Remove Build Folder: Cleans up the workspace by removing the build folder.
- Publish Application: Publishes the application to the Maximo Manage server.
- Verify Publish Status: Checks the status of the publishing process.
- Cleanup: Stops and removes the Docker container and workspace.
The script includes error handling for various stages, such as authentication failures, container startup issues, and publishing errors. Appropriate messages are displayed, and the script exits with a non-zero status code in case of errors.
This document provides an overview and explanation of the bitbucket-pipelines-mas-91.yaml configuration file used for setting up CI/CD pipelines in Bitbucket.
image: python:3.13-slimSpecifies the Docker image to be used for the pipeline. In this case, it uses python:3.13-slim image.
This step is used for publishing the mobile application.
- step: &publish-step
name: Mobile App Publish
max-time: 20
script:
- python -m venv maftool && . maftool/bin/activate
- pip install requests jmespath
- python ./mobile-app-publish.py --masAuthUrl $MAS_AUTH_URL --masApiUrl $MAS_API_URL --appId $APP_ID --appConfigUrl $APP_CONFIG_URL --appConfigUsername $APP_CONFIG_USERNAME --appConfigPassword $APP_CONFIG_PASSWORD
artifacts:
- build/**
services:
- docker- Docker: The Docker service is used in the pipeline.
Custom pipeline step is used for publishing the mobile application to the dev/test/prod environments.
Example step for PROD:
mobile-publish-prod:
- variables:
- name: APP_ID
default: "TECHMOBILE"
allowed-values:
- "TECHMOBILE"
- "SRMOBILE"
- "INSPECTION"
- "IRMOBILE"
- "ICMOBILE"
- step:
<<: *publish-step
deployment: PRODThis script automates the process of publishing a mobile application to the Maximo Manage server using the Application Configuration.
./mobile-app-publish.py --masAuthUrl <masAuthUrl> --masApiUrl <masApiUrl> --appId <appId> --appConfigUrl <appConfigUrl> --appConfigUsername <appConfigUsername> --appConfigPassword <appConfigPassword> masAuthUrl: https://auth.<mas_domain>masApiUrl: https://api.<mas_domain>appid: The ID of the mobile application to be publishedappConfigUrl: https://appconfig.<mas_domain>appConfigUsername: Admin user that has access to Application Configuration (appconfig)appConfigPassword: Password for the user
- Parses required command-line arguments for authentication and configuration.
- Authenticates to the Application Configuration using provided credentials.
- Retrieves user profile information to extract the workspace ID.
- Redownloads the latest application definition to ensure local changes are overwritten.
- Creates a zip archive of customized files from the repository.
- Uploads the zip file to the Application Configuration.
- Verifies the publish status in a loop until completion.
The script includes error handling for various stages, such as authentication failures and publishing errors. Appropriate messages are displayed.
