Improve upload testmunk script

This commit is contained in:
Leith Bade
2014-11-22 18:37:29 +11:00
parent ad27e0f2e2
commit fd3077bc7c
4 changed files with 27 additions and 23 deletions

View File

@@ -40,6 +40,8 @@ env:
- secure: "bG4YYWMfl9API0MSRgmOaJrlGLv06tRg9KJNawBieZvBJbITPpxVGJZT3/l/SEJ+Rl15e2dRex4k+MGQlmT2SqPQxTEYWv1qxNigKPPcla7IWeNmWWqW8uVvFjdglojgBOK2k/xErVQtA4zDfi3mwSXH4DKwquXWsoEKmX2SV7M="
- secure: "Cbvap9ubVKgjPe3hUhI6JGeDZzBXHpOG9RaYKh+SdoIPhKnlJiNOYm1egomi+e4uqJInlFKuVHTw7Ng9Cun6Zm0jIxpkSchv1GpsR7hmB3UGnGed19Dw8121FwuUaktN+4YnbVlsyd+u8EHD3+h58t4eELrLrZolM4rS7DL6caA="
- secure: "RiBIBfVhhaMjU5ksuwJO3shdvG9FpinBjdSv4co9jg9171SR8edNriedHjVKSIeBhSGNmZmX+twS3dJS/By6tl/LKh9sTynA+ZAYYljkE7jn881B/gMrlYvdAA6og5KvkhV1/0iJWlhuZrMTkhpDR200iLgg3EWBhWjltzmDW/I="
# TODO: generate a new API key before using paid testmonk plan
- secure: "Kn+8PGaACTCClxSfJzfWHIP4quklhYtfWplPLU/PsXvq+Xv++vx341I2T2+VL8AvhUs33dd2FrtMsBYFdYXtirYCojGg8/+lN5l2p8bAXZtmFFHQb5g6WdzwvqS19bmmJzfna7Tu95GijfW3Fztty0P0muRDXa07uPthP0G3KYw="
- LD_LIBRARY_PATH: '/usr/local/lib'
- TERM=dumb

22
android/test/upload_testmunk.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
set -o pipefail
APP_NAME = "Mapbox"
APK_PATH = $1
echo "submitting testrun to testmunk"
echo "uploading features"
echo
zip -r features.zip features/
curl -H 'Accept: application/vnd.testmunk.v1+json' -F 'file=@features.zip' 'https://${TESTMONK_KEY}@api.testmunk.com/apps/${APP_NAME}/testcases'
echo "uploading apk"
echo
cd `dirname ${APK_PATH}`
curl -H 'Accept: application/vnd.testmunk.v1+json' -F 'file=@`basename ${APK_PATH}`' -F 'email=leith@mapbox.com' -F 'autoStart=true' -F 'public=true' 'https://${TESTMONK_KEY}@api.testmunk.com/apps/${APP_NAME}/testruns'
cd -

View File

@@ -10,8 +10,9 @@ if [[ $MASON_PLATFORM == "android" ]]; then
mapbox_time "compile_program" \
make android -j$JOBS BUILDTYPE=${BUILDTYPE}
mapbox_time "upload_testmunk" \
./scripts/upload_testmunk.sh
mapbox_time_start "upload_testmunk"
(cd ./android/test/ && ./upload_testmunk.sh /android/java/app/build/outputs/app-debug.apk)
mapbox_time_finish
elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
#
# build & test Linux

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
echo "submitting testrun to testmunk"
echo "uploading features"
echo
cd android/test
zip -r features.zip features/
curl -H 'Accept: application/vnd.testmunk.v1+json' -F 'file=@features.zip' 'https://If1ONAxGqcIgiI1vtK468V54ERJf1xem@api.testmunk.com/apps/Testmunk/testcases'
cd ../..
echo "uploading apk"
echo
cd android/java/app/build/outputs/apk/
curl -H 'Accept: application/vnd.testmunk.v1+json' -F 'file=@app-debug.apk' -F 'email=leith@mapbox.com' -F 'autoStart=true' -F 'public=true' 'https://If1ONAxGqcIgiI1vtK468V54ERJf1xem@api.testmunk.com/apps/Mapbox/testruns'
cd ../../../../../..