Tuesday, 16 December 2014

Configure Jenkins for Android - HockeyApp automatic upload

One of the benefits with Jenkins is with some extra plugins, it could automatise actions such as upload the app to test. This happens with the HockeyApp plugin, which allow the user to upload the compiled file to HockeyApp.

The steps to do it are:
1. Install HockeyApp plugin for Jenkins
1.1 On the main page of Jenkins, click on "Manage Jenkins" -> "Manage Plugins"
1.2 Click on the tab "Available"
1.3 Check the checkbox of "HockeyApp Plugin"
1.4 Click on "Download now and install after restart"
1.5 On the new screen, check "Restart Jenkins when installation is complete and no jobs are running"

2. Create a new app in HockeyApp
2.1 Log in or register yourself in HockeyApp
2.2 On the dashboard, click on "New App". You could fill the data manually or upload an old version of your app.
The new app will have an App ID. Remember where is because Jenkins need it.
2.3 On the top right, click on "Account settings"
2.4 On the bottom left, click on "API Tokens"
2.5 On the "Create API Token" block, select the new app, the right (I have chosen Full access) and enter a name.
A new API Token will be generated at the bottom. Copy it.

3. Config Jenkins
3.1 On Jenkins, go to the configuration page of your app
3.2 On the block "Post-build Actions", click on "Add post-build action" and select "Upload to HockeyApp".
3.3 A new configuration screen will appear. Fill the API Token with the token copied on the step 2.5.
3.4 On the field "Upload Method", select "Upload Version" and paste the App ID created on the step 2.2.
Other options could be set, but with App Token and App ID, Jenkins can upload the app to HockeyApp correctly.

No comments:

Post a Comment