I can't build project app with Jenkins

454 views
Skip to first unread message

Lilya

unread,
May 20, 2013, 1:44:42 AM5/20/13
to frank-...@googlegroups.com
I want to run frank as part from Jenkins and I'm doing all from this article http://blog.thepete.net/blog/2012/07/22/running-frank-as-part-of-ios-ci/
When I call sh script from command line, it is all okey.

But in Jenkins :

rake aborted!
xcodebuild failed (exited with status: 65)

Stewart Gleadow

unread,
May 20, 2013, 3:11:21 AM5/20/13
to frank-...@googlegroups.com
Is there more output than that? Maybe there is a verbose option?

xcodebuild is notoriously noisy, but it looks like the actual calls to xcodebuild is failing rather than something within Frank itself. If it can't even find the xcodebuild command, it might be that the Xcode Command Line Tools have not been installed.

cheers,
Stew


--
You received this message because you are subscribed to the Google Groups "Frank" group.
To unsubscribe from this group and stop receiving emails from it, send an email to frank-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Lilya

unread,
May 20, 2013, 3:41:03 AM5/20/13
to frank-...@googlegroups.com
Jenkins output:

Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (0.9.2.2) 
Installing i18n (0.6.1) 
Installing multi_json (1.3.6) 
Installing activesupport (3.2.8) 
Installing builder (3.1.4) 
Installing diff-lcs (1.1.3) 
Installing json (1.7.5) 
Installing gherkin (2.11.5) 
Installing cucumber (1.2.1) 
Installing dnssd (2.0) 
Installing plist (3.1.0) 
Installing rspec-core (2.11.1) 
Installing rspec-expectations (2.11.3) 
Installing rspec-mocks (2.11.3) 
Installing rspec (2.11.0) 
Installing rack (1.4.1) 
Installing rack-protection (1.2.0) 
Installing tilt (1.3.3) 
Installing sinatra (1.3.3) 
Installing sim_launcher (0.4.6) 
Installing thor (0.16.0) 
Installing xcodeproj (0.3.4) 
Installing frank-cucumber (1.1.12) 
Installing state_machine (1.1.2) 
Installing xcodebuild-rb (0.3.0) 
Using bundler (1.3.5) 
Your bundle is complete!
It was installed into ./vendor/bundle
rake aborted!
xcodebuild failed (exited with status: 65)
/Library/Ruby/Gems/1.8/gems/xcodebuild-rb-0.3.0/lib/xcode_build/tasks/build_task.rb:134:in `check_status'
/Library/Ruby/Gems/1.8/gems/xcodebuild-rb-0.3.0/lib/xcode_build/tasks/build_task.rb:92:in `xcodebuild'
/Library/Ruby/Gems/1.8/gems/xcodebuild-rb-0.3.0/lib/xcode_build/tasks/build_task.rb:120:in `define'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:246:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:184:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:205:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:183:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:205:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:183:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:73:in `run'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Tasks: TOP => default => xcode:debug_simulator:cleanbuild => xcode:debug_simulator:build

Ondrej Hanslik

unread,
May 20, 2013, 7:12:53 AM5/20/13
to frank-...@googlegroups.com
I guess xcodebuild doesn't have access to your keychain, usually it's helpful tu unlock keychain explicitely before building

security unlock -p "$KEYCHAIN_PASSWORD"

Lilya

unread,
May 21, 2013, 2:14:05 AM5/21/13
to frank-...@googlegroups.com
a tryed but it didn't help

Ondrej Hanslik

unread,
May 21, 2013, 6:26:45 AM5/21/13
to frank-...@googlegroups.com
Result code 65 is EX_DATAERR (65) which means
The input data was incorrect in some way. This should only be used for user's data and not system files.

That can be anything from compilation problems to missing certificates in the keychain.

How is it connected to Frank, by the way? Frank doesn't use the xcodebuild-rb gem.

Ondrej Hanslik

unread,
May 21, 2013, 12:40:45 PM5/21/13
to frank-...@googlegroups.com
Unfortunately, I can't help you with the ruby building scripts but I can show you my jenkins build script. It's not ruby, it's just a simple shell script.
(You will have to change the file paths a bit)

#!/bin/bash

#

# This script builds (MYAPP), generates signed IPA file and validates it.


function print_usage {

   printf "(MYAPP) Command Line Build Script\n"

   printf "Usage: $0"

   printf " -B bundle_id"

   printf " -P provisioning_profile"

   printf " -C certificate"

   printf " -c configuration"

   printf " -s src_dir"

   printf " -n build_number"

   printf " -d dest_dir"

   printf "\n"

}


# Handling Arguments


while getopts hB:P:C:c:v:s:n:d: OPTION; do

case "$OPTION" in

    h)

        print_usage

        exit 0

    ;;

    B) BUNDLE_IDENTIFIER="$OPTARG";;

    P) PROVISIONING_PROFILE="$OPTARG";;

    C) CERTIFICATE="$OPTARG";;

    c) CONFIG="$OPTARG";;

    s) SRC="$OPTARG";;

    n) BUILD_NUMBER="$OPTARG";;

    d) DEST_DIR="$OPTARG";;

    [?])

        print_usage

        exit 1

    ;;

esac

done


PROFILES_DIR="$HOME/Library/MobileDevice/Provisioning Profiles"


IPA_FILE=$SRC/build/$CONFIG-iphoneos/MyApp.ipa

APP_FILE=$SRC/build/$CONFIG-iphoneos/MyApp.app

DSYM_FILE="$APP_FILE.dSYM"


echo "##### Clean Up #####"


rm -rf $SRC/build


echo "##### Configuration (adding jenkins build number to the version) #####"


VERSION_SHORT=`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" $SRC/MyApp/MyApp-Info.plist`

VERSION_LONG="$VERSION_SHORT Build $BUILD_NUMBER"


/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSION_LONG" $SRC/MyApp/MyApp-Info.plist

/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $BUNDLE_IDENTIFIER" $SRC/MyApp/MyApp-Info.plist


printf "##### Compilation %s #####\n" "$VERSION_LONG"


xcodebuild \

    -project $SRC/MyApp.xcodeproj \

    -sdk "iphoneos" \

    -configuration "$CONFIG" \

    clean build \

    CODE_SIGN_IDENTITY="$CERTIFICATE" \

    PROVISIONING_PROFILE="$PROVISIONING_PROFILE"


if [ $? != 0 ]; then

    exit 1

fi


echo "##### Packaging & Signing #####"


xcrun \

    -sdk iphoneos PackageApplication \

    -v $APP_FILE \

    -o $IPA_FILE \

    --sign "$CERTIFICATE" \

    --embed "$PROFILES_DIR/$PROVISIONING_PROFILE.mobileprovision"


if [ $? != 0 ]; then

    exit 1

fi


echo "##### IPA Validation #####"


xcrun \

    -sdk "iphoneos" \

    Validation \

    $IPA_FILE


if [ $? != 0 ]; then

    exit 1

fi


if [ -n "$DEST_DIR" ]; then

    cp -rv "$IPA_FILE" "$DSYM_FILE" "$DEST_DIR"

fi


echo "##### Success! #####"

Ondrej Hanslik

unread,
May 22, 2013, 9:07:07 AM5/22/13
to frank-...@googlegroups.com
Please, also note, that jenkins has a "xcodebuild" plugin. This could simplify your script a great deal.

Reply all
Reply to author
Forward
0 new messages