Created
June 18, 2010 23:44
-
-
Save AlexNachbaur/444377 to your computer and use it in GitHub Desktop.
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
CONFIGURATIONS="Distribution Release" | |
ProvisionRelease=9807906A-42AF-425E-BD50-80D92E523997.mobileprovision | |
ProvisionDistribution=9EB28E74-33F5-4DDA-9E10-A4C9CC7F5294.mobileprovision |
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/sh | |
function failed() | |
{ | |
echo "Failed $*: $@" >&2 | |
exit 1 | |
} | |
set -ex | |
git clean -dfx | |
export OUTPUT=$WORKSPACE/output | |
rm -rf $OUTPUT | |
mkdir -p $OUTPUT | |
PROFILE_HOME=~/Library/MobileDevice/Provisioning\ Profiles/ | |
KEYCHAIN=~/Library/Keychains/login.keychain | |
. "$WORKSPACE/autobuild/build.config" | |
[ -d "$PROFILE_HOME" ] || mkdir -p "$PROFILE_HOME" | |
security unlock -p `cat ~/.build_password` | |
agvtool new-version -all $BUILD_NUMBER | |
for config in $CONFIGURATIONS; do | |
provision=$(eval echo \$`echo Provision$config`) | |
cert="$WORKSPACE/autobuild/$provision" | |
archive="$OUTPUT/$JOB_NAME-$BUILD_NUMBER-$config.zip"; | |
ipaname="$OUTPUT/$JOB_NAME-$BUILD_NUMBER-$config.ipa" | |
provname="$OUTPUT/$JOB_NAME-$BUILD_NUMBER-$config.mobileprovision" | |
[ -f "$cert" ] && cp "$cert" "$PROFILE_HOME" | |
xcodebuild -activetarget -configuration $config build || failed build; | |
( | |
cd build/$config-iphoneos || failed "no build output"; | |
if [ "x$config" = "xDistribution" ]; then | |
rm -rf Payload | |
rm -f *.ipa | |
mkdir Payload | |
cp -Rp *.app Payload/ | |
cp -f $WORKSPACE/Images/icon-512.png Payload/iTunesArtwork | |
zip -r $ipaname Payload | |
cp $cert $provname | |
else | |
zip -r -T -y "$archive" *.app $provision || failed zip; | |
fi | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment