New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having trouble getting Carthage to work with Xcode CI server #289

Closed
schultzjim opened this Issue Jan 27, 2015 · 13 comments

Comments

Projects
None yet
7 participants
@schultzjim

schultzjim commented Jan 27, 2015

I'm a big Carthage noob here but here's the error i'm seeing http://cl.ly/image/2P080X2E2V0C

I've tried this https://github.com/Carthage/Carthage#adding-frameworks-to-unit-tests-or-a-framework but it makes no difference.

@schultzjim

This comment has been minimized.

Show comment
Hide comment
@schultzjim

schultzjim Jan 27, 2015

Here's the .gitignore lines for Carthage: http://cl.ly/image/2F2Q1A3c0b3B

schultzjim commented Jan 27, 2015

Here's the .gitignore lines for Carthage: http://cl.ly/image/2F2Q1A3c0b3B

@robb

This comment has been minimized.

Show comment
Hide comment
@robb

robb Jan 27, 2015

Member

I have never used Xcode CI server but have you checked the built frameworks correctly into git or are you executing carthage bootstrap as part of CI?

Member

robb commented Jan 27, 2015

I have never used Xcode CI server but have you checked the built frameworks correctly into git or are you executing carthage bootstrap as part of CI?

@robb robb added the question label Jan 27, 2015

@schultzjim

This comment has been minimized.

Show comment
Hide comment
@schultzjim

schultzjim Jan 27, 2015

hey robb, to be honest i'm really not sure what the best way to set this up either. the Carthage directory/framework is not checked into git. I'm not familiar with carthage bootstrap. Do you have some docs i can refer to? or do you know of another CI service that plays well with Carthage? on a side note, i work with caselas, he speaks highly of you.

schultzjim commented Jan 27, 2015

hey robb, to be honest i'm really not sure what the best way to set this up either. the Carthage directory/framework is not checked into git. I'm not familiar with carthage bootstrap. Do you have some docs i can refer to? or do you know of another CI service that plays well with Carthage? on a side note, i work with caselas, he speaks highly of you.

@robb

This comment has been minimized.

Show comment
Hide comment
@robb

robb Jan 27, 2015

Member

I see three solutions

  • Check in the Carthage/Build folder. This will increase the size of your repo over time, these binary assets may also compress poorly. Not my style but probably the easiest solution.

  • Run carthage bootstrap as part of your CI process. You could try and add a new Build Phase to your test target that runs a script along the lines of

    if [[ "$USER" == "_teamsserver" ]]
    then
        /usr/local/bin/carthage bootstrap "$SRCROOT"
    fi
    

    I understand _teamserver is the name of the user that runs the test?

  • Search for a CocoaPods solution and replace pod install with carthage bootstrap :trollface:

P.s.: Say hi to Chris from me 👋

Member

robb commented Jan 27, 2015

I see three solutions

  • Check in the Carthage/Build folder. This will increase the size of your repo over time, these binary assets may also compress poorly. Not my style but probably the easiest solution.

  • Run carthage bootstrap as part of your CI process. You could try and add a new Build Phase to your test target that runs a script along the lines of

    if [[ "$USER" == "_teamsserver" ]]
    then
        /usr/local/bin/carthage bootstrap "$SRCROOT"
    fi
    

    I understand _teamserver is the name of the user that runs the test?

  • Search for a CocoaPods solution and replace pod install with carthage bootstrap :trollface:

P.s.: Say hi to Chris from me 👋

@schultzjim

This comment has been minimized.

Show comment
Hide comment
@schultzjim

schultzjim Jan 27, 2015

thanks robb, adding the assets to the repo isn't my preference either, i'll give bootstrap a try.

schultzjim commented Jan 27, 2015

thanks robb, adding the assets to the repo isn't my preference either, i'll give bootstrap a try.

@schultzjim

This comment has been minimized.

Show comment
Hide comment
@schultzjim

schultzjim Jan 28, 2015

I've been able to get the bootstrap to run on the server, however it errors out with a CodeSign issue.

** BUILD FAILED **


The following build commands failed:
    CodeSign /var/_xcsbuildd/Library/Developer/Xcode/DerivedData/Alamofire-grezeuvjkqxnywbolfaiwskpnyhx/Build/Products/Release-iphoneos/Alamofire.framework
(1 failure)

*** Fetching Alamofire
*** Checking out Alamofire at "1.1.3"
*** xcodebuild output can be found in /var/folders/q3/_8nk46b9399flvj1sb8773b8000086/T/carthage-xcodebuild.JZyzlR.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace

I've been following this cocoa pods example. http://papaanton.com/setting-up-xcode-6-and-apple-server-4-0-for-continues-integration-with-cocoapods/

schultzjim commented Jan 28, 2015

I've been able to get the bootstrap to run on the server, however it errors out with a CodeSign issue.

** BUILD FAILED **


The following build commands failed:
    CodeSign /var/_xcsbuildd/Library/Developer/Xcode/DerivedData/Alamofire-grezeuvjkqxnywbolfaiwskpnyhx/Build/Products/Release-iphoneos/Alamofire.framework
(1 failure)

*** Fetching Alamofire
*** Checking out Alamofire at "1.1.3"
*** xcodebuild output can be found in /var/folders/q3/_8nk46b9399flvj1sb8773b8000086/T/carthage-xcodebuild.JZyzlR.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace

I've been following this cocoa pods example. http://papaanton.com/setting-up-xcode-6-and-apple-server-4-0-for-continues-integration-with-cocoapods/

@jspahrsummers

This comment has been minimized.

Show comment
Hide comment
@jspahrsummers

jspahrsummers Jan 28, 2015

Member

You'll need to have an iOS signing certificate set up on CI.

Member

jspahrsummers commented Jan 28, 2015

You'll need to have an iOS signing certificate set up on CI.

@schultzjim

This comment has been minimized.

Show comment
Hide comment
@schultzjim

schultzjim Jan 28, 2015

@jspahrsummers ya i understand that much. I've configured the server as described here: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/200-Adopting_a_Continuous_Integration_Workflow/adopt_continuous_integration.html#//apple_ref/doc/uid/TP40013292-CH3-SW1

which states

The Server app connects to your Apple Developer account and downloads its own set of certificates, private keys, signing identities, and provisioning profiles for apps that are registered with your team.

I've also attempted to manually added the certs from my development machine as described here: http://papaanton.com/setting-up-xcode-6-and-apple-server-4-0-for-continues-integration-with-cocoapods/

however i'm still getting code sign issues. Any chance you can provide more specific details on adding the correct iOS signing certificates to the CI that work with Carthage?

schultzjim commented Jan 28, 2015

@jspahrsummers ya i understand that much. I've configured the server as described here: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/200-Adopting_a_Continuous_Integration_Workflow/adopt_continuous_integration.html#//apple_ref/doc/uid/TP40013292-CH3-SW1

which states

The Server app connects to your Apple Developer account and downloads its own set of certificates, private keys, signing identities, and provisioning profiles for apps that are registered with your team.

I've also attempted to manually added the certs from my development machine as described here: http://papaanton.com/setting-up-xcode-6-and-apple-server-4-0-for-continues-integration-with-cocoapods/

however i'm still getting code sign issues. Any chance you can provide more specific details on adding the correct iOS signing certificates to the CI that work with Carthage?

@swizzlr

This comment has been minimized.

Show comment
Hide comment
@swizzlr

swizzlr Jan 29, 2015

Contributor

@boxenjim Have you checked the keychain? Carthage literally just shells out an xcodebuild, so if xcodebuild can't find the certs it's probably Apple's problem, at which point you're in magic incantation land (restarts etc)

Contributor

swizzlr commented Jan 29, 2015

@boxenjim Have you checked the keychain? Carthage literally just shells out an xcodebuild, so if xcodebuild can't find the certs it's probably Apple's problem, at which point you're in magic incantation land (restarts etc)

@jspahrsummers

This comment has been minimized.

Show comment
Hide comment
@jspahrsummers

jspahrsummers Jan 29, 2015

Member

Yeah, I'm afraid at this point that this lies within Xcode's territory. Since none of us have used the Xcode CI thing, I don't think we can offer much more help. Sorry about that!

Member

jspahrsummers commented Jan 29, 2015

Yeah, I'm afraid at this point that this lies within Xcode's territory. Since none of us have used the Xcode CI thing, I don't think we can offer much more help. Sorry about that!

@lunastorm

This comment has been minimized.

Show comment
Hide comment
@lunastorm

lunastorm May 12, 2015

try to grant access to "codesign" for the signing identity's private key on the machine where Xcode Server is installed

untitled

it works for me now

lunastorm commented May 12, 2015

try to grant access to "codesign" for the signing identity's private key on the machine where Xcode Server is installed

untitled

it works for me now

@kylejm

This comment has been minimized.

Show comment
Hide comment
@kylejm

kylejm Jul 3, 2015

@boxenjim: Finally, after an afternoon of tinkering, I've got Xcode Server to work with Cartage.

The fix for me was to move the keys to the System keychain.

🎉

kylejm commented Jul 3, 2015

@boxenjim: Finally, after an afternoon of tinkering, I've got Xcode Server to work with Cartage.

The fix for me was to move the keys to the System keychain.

🎉

@adcooley

This comment has been minimized.

Show comment
Hide comment
@adcooley

adcooley Jul 15, 2015

hey guys, i'm running into this same issue, but i'm dealing with a remotely managed system at bitrise.io. I can run shell scripts but not sure how I'd go about "moving the keys to the System keychain from the shell. Any suggestions?

adcooley commented Jul 15, 2015

hey guys, i'm running into this same issue, but i'm dealing with a remotely managed system at bitrise.io. I can run shell scripts but not sure how I'd go about "moving the keys to the System keychain from the shell. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment