Created
October 24, 2012 17:55
-
-
Save cseeger/3947692 to your computer and use it in GitHub Desktop.
build script for jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html | |
PROJECT_NAME="" | |
TARGET_SDK="iphoneos" | |
APPLICATION_NAME="" | |
DEVELOPER_NAME="iPhone Distribution: blahblah." | |
PROVISIONING_PROFILE="ProductionPush_10_10.mobileprovision" | |
TIME_STAMP="$(date +%m/%d/%y) $(date +%r)" | |
function setup() { | |
export OUTPUT=$WORKSPACE/output | |
rm -rf build | |
rm -rf $OUTPUT | |
mkdir -p $OUTPUT | |
} | |
function build_app() { | |
xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Release | |
} | |
function package_app() { | |
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "build/Release-iphoneos/${APPLICATION_NAME}.app" -o "$OUTPUT/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISIONING_PROFILE}" | |
} | |
function deploy_testflight() { | |
curl http://testflightapp.com/api/builds.json -F file=@$OUTPUT/${APPLICATION_NAME}.ipa -F api_token='61d60ef6bd9' -F team_token='bb8a04d28a' -F notes="Created: ${TIME_STAMP}" -F notify=false -F distribution_lists='Internal' | |
} | |
echo "**** Setup" | |
setup | |
echo | |
echo "**** Build" | |
build_app | |
echo "**** Package Application" | |
package_app | |
echo | |
echo "*** Sending to TestFlight" | |
deploy_testflight | |
echo "**** Complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment