This feature might change or be backward compatible. However, we are testing it now.
Bitrise is a Continuous Integration and Delivery Platform as a Service. MoQuality integrates with the workflows of Bitrise by adding a step to a workflow. The following instructions outline how to integrate MoQuality with your Bitrise workflow.
MoQuality hosts a GitHub repository that contains example code for all of our CI/CD integrations, including Bitrise. You can take advantage of this repository by running the following command in the directory of your choosing.
git clone https://github.com/moquality/devcenter.git
Set your MoQuality email, password as environment variables. You can also set
APK_PATH which is the path to your folder for apk's.
export MQ_EMAIL=[OBTAINED_VALUE] export MQ_PASSWORD=[OBTAINED_VALUE] export APK_PATH=/Users/[USERNAME]/Calculator/app/build/outputs/apk/
bitrise.yml is in your main directory, and open the file in an editor.
In bitrise.yml, there should be environment variables
GRADLEW_PATH. These are the paths to your build.gradle and gradlew files, respectively. You can find these paths using your file explorer. When you know the paths, enter them in bitrise.yml for their respective variables. The below code is an example of how your variables might look.
app: envs: - GRADLE_BUILD_FILE_PATH: /Users/[USERNAME]/Calculator/build.gradle - GRADLEW_PATH: /Users/[USERNAME]/Calculator/gradlew
There are two default workflows in bitrise.yml: deploy and primary. To begin adding a step integrating MoQuality with either of these workflows, remove the last two steps,
In place of those steps, add:
- email@example.com: title: Install MQ CLI and Upload App to MoQuality inputs: - content: |
The following sub-instructions explain how to install the
mq-cli and upload a new build of an app. These commands can either be run through a shell script or placed directly into
bitrise.yml. Below are the commands to upload an app to MoQuality:
npm install -g mq-cli mq login -e $MQ_EMAIL -p $MQ_PASSWORD mq upload -f $APK_PATH/app-debug.apk mq apps
npm install mq-cliinstalls the MQ CLI.
mq loginwill log you in.
mq userreturns user information, and you can check that your user is correct.
mq uploadwill upload your app, whose location is provided by
mq appsreturns a list of the user's apps, and you can confirm that your app version has incremented by one.
Your new step, integrating MoQuality with Bitrise, should be formatted like one of the two examples below.
- firstname.lastname@example.org: title: Install MQ CLI and Upload App to MoQuality inputs: - content: | npm install -g mq-cli mq login -e $MQ_EMAIL -p $MQ_PASSWORD mq upload -a $APP_ID -f $APK_PATH/app-debug.apk mq apps - email@example.com: title: Install MQ CLI and Upload App to MoQuality inputs: - content: | sh [SCRIPT_NAME].sh
Run this workflow with
bitrise run [WORKFLOW].
Don't worry about this error. Run the workflow again, and it should work.