flyve-mdm / ios-inventory-agent

Flyve MDM Inventory Agent
http://flyve.org/ios-inventory-agent/
Other
29 stars 17 forks source link

Distributing the app #17

Closed ajsb85 closed 7 years ago

ajsb85 commented 7 years ago

TestFlight Beta Testing with Travis CI

Create some release notes:

RELEASE_DATE=`date '+%Y-%m-%d %H:%M:%S'`
RELEASE_NOTES="Build: $TRAVIS_BUILD_NUMBER\nUploaded: $RELEASE_DATE"

Create a TestFlight account and set up your app. In order to use the TestFlight API, you need to get the api_token and team_token first. Again, we have to make sure to encrypt them. On the command line execute:

travis encrypt "TESTFLIGHT_API_TOKEN={api_token}" --add
travis encrypt "TESTFLIGHT_TEAM_TOKEN={team_token}" --add

Now we can call the API accordingly. Add this to the sign-and-build.sh:

curl http://testflightapp.com/api/builds.json \
  -F file="@$OUTPUTDIR/$APP_NAME.ipa" \
  -F dsym="@$OUTPUTDIR/$APP_NAME.app.dSYM.zip" \
  -F api_token="$TESTFLIGHT_API_TOKEN" \
  -F team_token="$TESTFLIGHT_TEAM_TOKEN" \
  -F distribution_lists='Internal' \
  -F notes="$RELEASE_NOTES"

Make sure NOT to use the verbose flag (-v), as this would expose your decrypted tokens!

Reference: https://www.objc.io/issues/6-build-tools/travis-ci/

Badge: apple-store

ajsb85 commented 7 years ago

Test Information

ajsb85 commented 7 years ago

You can change the permissions to execute the scripts with git:

git update-index --chmod=+x scripts/add-key.sh
git update-index --chmod=+x scripts/testflight.sh
git update-index --chmod=+x scripts/remove-key.sh

Then you can remove the lines:

- chmod a+x scripts/add-key.sh
- chmod a+x scripts/testflight.sh
- chmod a+x scripts/remove-key.sh