In short I: Bought a mac mini and set it up with OS X Server, connected my git hub repos, created a bot that will archive and upload to test flight api on a commit (just for the sake of testing).
I can get all the way through getting the archive actually created with a post action archive script, but I can't get it uploaded to test flight. My issue is in the timing, and something I'm not grasping with the process.
I've used a number of scripts found throughout SO and Google, but none of them seem to be current to Xcode 6 and Server 4. I had to change some paths to get it to work.
Basically, I cannot get the path to my new IPA at the time I want to upload it to test flight. The path does not seem to exist until after my script has already finished running. The only reason I think this is because in the integration logs, it shows the script being completed and failing to upload to test flight, but then at the very very end of the log it prints:
Results at '/var/folders/5t/5vbf87x514l3ql2mpfqthgt8000086/T/C437286E-F5F4-4AF7-8F74-58312D095B42-87064-00004C27156D38DE/ServerTest.ipa'
Moving exported product to '/Library/Developer/XcodeServer/Integrations/Integration-9279f091e32c0f0299d526e76e1c6b27/ServerTest Bot.ipa' ** EXPORT SUCCEEDED **
So I know how to get that path, but that path doesn't seem to exist until after I've already needed it.
Any thoughts?
UPDATE: Also tried using this script, exact same issue Is there any automatic Testflight upload script on application archiving?
TEAM_TOKEN="XXX"
DISTRIBUTION_LISTS="XXX"
PROVISIONING_PROFILE="/Library/Developer/XcodeServer/ProvisioningProfiles/XXX.mobileprovision"
SIGNING_IDENTITY="iPhone Distribution: XXX"
# DO NOT EDIT BELOW HERE!
########################################
DSYM="/tmp/Archive.xcarchive/dSYMs/${PRODUCT_NAME}.app.dSYM"
#IPA="/tmp/${PRODUCT_NAME}.ipa"
IPA="${XCS_OUTPUT_DIR}/${PRODUCT_NAME} Bot.ipa"
APP="/tmp/Archive.xcarchive/Products/Applications/${PRODUCT_NAME}.app"
# Clear out any old copies of the Archive
echo "Removing old Archive files from /tmp...";
/bin/rm -rf /tmp/Archive.xcarchive*
#Copy over the latest build the bot just created
echo "Copying latest Archive to /tmp/...";
#LATESTBUILD=$(ls -1rt /Library/Server/Xcode/Data/BotRuns | tail -1)
#bin/cp -Rp "/Library/Server/Xcode/Data/BotRuns/${LATESTBUILD}/output/Archive.xcarchive" "/tmp/"
/bin/cp -Rp "${XCS_OUTPUT_DIR}/Archive.xcarchive" "/tmp/"
echo "Creating .ipa for ${PRODUCT_NAME}"
/bin/rm "${IPA}"
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${IPA}" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}"
echo "Done with IPA creation."
echo "Zipping .dSYM for ${PRODUCT_NAME}"
/bin/rm "${DSYM}.zip"
/usr/bin/zip -r "${DSYM}.zip" "${DSYM}"
echo "Created .dSYM for ${PRODUCT_NAME}"
echo "*** Uploading ${PRODUCT_NAME} to TestFlight ***"
/usr/bin/curl "http://testflightapp.com/api/builds.json" \
-F file=@"${IPA}" \
-F dsym=@"${DSYM}.zip" \
-F api_token="${API_TOKEN}" \
-F team_token="${TEAM_TOKEN}" \
-F distribution_lists="${DISTRIBUTION_LISTS}" \
-F notes="Build uploaded automatically from Xcode Server Bot."
echo "TestFlight upload finished!"