Created
October 7, 2009 21:32
-
-
Save AlexAstroCat/204459 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
function failed() | |
{ | |
echo "Failed: $@" >&2 | |
exit 1 | |
} | |
set -ex | |
export OUTPUT=$WORKSPACE/output | |
rm -rf $OUTPUT | |
mkdir -p $OUTPUT | |
PROFILE_HOME=~/Library/MobileDevice/Provisioning\ Profiles/ | |
KEYCHAIN=~/Library/Keychains/login.keychain | |
. "$WORKSPACE/build/build.config" | |
[ -d "$PROFILE_HOME" ] || mkdir -p "$PROFILE_HOME" | |
security unlock -p $PASSWORD | |
cd $WORKSPACE/iphone; | |
agvtool new-version -all $BUILD_NUMBER | |
for sdk in $SDKS; do | |
for config in $CONFIGURATIONS; do | |
provision=$(eval echo \$`echo Provision$config`) | |
cert="$WORKSPACE/build/$provision" | |
archive="$OUTPUT/$JOB_NAME-$BUILD_NUMBER-$config.zip"; | |
[ -f "$cert" ] && cp "$cert" "$PROFILE_HOME" | |
cd $WORKSPACE/iphone | |
xcodebuild -configuration $config -sdk $sdk clean; | |
xcodebuild -configuration $config -sdk $sdk || failed build; | |
cd build/$config-iphoneos; | |
if [ $config == "Release" ]; then | |
zip -r -T -y "$archive" *.app* || failed zip | |
zip -j -T "$archive" "$WORKSPACE/iphone/icon.png" || failed icon | |
else | |
zip -r -T -y "$archive" *.app || failed zip | |
zip -j -T "$archive" "$cert" || failed cert | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment