Jenkins
Build and upload both your Android (APK) & iOS (IPA) to notify your testers for testing and feedback using Jenkins Freestyle Project & Pipeline
Install Jenkins with docker
Assuming docker is installed. Use the following command to start the Jenkins server.
docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins:lts-jdk11
Open http://localhost:8080
and get the credentials from the log:
docker logs jenkins
Follow the instructions to complete the setup.
Setup the Jenkins job
Depending on how you use Jenkins, please choose one of the two options to upload your package.
Option 1: Freestyle Project
- Create a
Freestyle Project
job, please DO NOT have blank in the name, let's say upload-mobile-package - Add parameters to the job as below tables shown
Parameter Type | Parameter Name | Default Value | Description |
---|---|---|---|
String Parameter | api_token | You can get it from https://portal.testapp.io/settings/api-credentials | |
String Parameter | app_id | You can get it from your app page at https://portal.testapp.io/apps | |
Choice Parameter | release | It can be either both or android or ios | |
String Parameter | apk | /user/path/to/app.apk (if you select release both or android) | |
String Parameter | ipa | /user/path/to/app.ipa (if you select release both or ios) | |
String Parameter | release_notes | Manually add the release notes to be displayed for the testers | |
Boolean Parameter | notify | Send notifications to your team members about this release |
Check TA-CLI for more info
- Add a
Execute Shell
build step, and paste the following code
export INSTALL_DIR=`pwd`
if [ ! -f ${INSTALL_DIR}/ta-cli ]
then
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
else
${INSTALL_DIR}/ta-cli version | grep "You are using the latest version"
if [ $? -ne 0 ]
then
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
fi
fi
export PATH=$INSTALL_DIR:$PATH
chmod 0755 $INSTALL_DIR/ta-cli
$INSTALL_DIR/ta-cli publish --api_token=$api_token --app_id=$app_id --release=$release --apk=$apk --ipa=$ipa --release_notes="$release_notes" --notify=$notify --source="Jenkins"
- Integrate with existing Jenkins CI process
Call this job from other jobs which build the APK/IPA packages.
Option 2: pipeline (Jenkinsfile)
Please add the below stage to your pipeline script after the build stage.
node {
stage('Upload to TestApp.io') {
api_token = 'Your API Token'
app_id = 'Your App ID'
release = 'both'
apk = '/tmp/data/sample-app.apk' // /user/path/to/app.apk (if you select release both or android)
ipa = '/tmp/data/sample-app.ipa' // /user/path/to/app.ipa (if you select release both or ios)
release_notes = "My release notes..."
notify = false
// Install ta-cli
sh '''
export INSTALL_DIR=`pwd`
if [ ! -f ${INSTALL_DIR}/ta-cli ]
then
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
else
${INSTALL_DIR}/ta-cli version | grep "You are using the latest version"
if [ $? -ne 0 ]
then
curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash
fi
fi
'''
// do the job now
sh "./ta-cli publish --api_token=$api_token --app_id=$app_id --release=$release --apk=$apk --ipa=$ipa --release_notes=$release_notes --notify=$notify --source=Jenkins"
}
}
Feedback & Support
Developers built TestApp.io to solve the pain of app distribution for mobile app development teams.
Join our community for feedback and support.
Happy releasing 🎉