0

I'm trying to automate my build proces via VSTS Continuous Integration. VSTS comes with a task that can build the project for me but I'm already using fastlane locally so I prefer to use this on the build server as well. I created a shell script that executes fastlane and publishes the artifacts. The command I use to build is:

fastlane gym \
-p "app.xcodeproj" \
-n "app.ipa" \
-c true \
-q "Debug" \
-j "development" \
-i "iPhone Developer: Firstname Lastname" \
-z false \
--verbose

And this produces the following command:

xcodebuild \
-scheme app-Debug \        
-project app.xcodeproj \
-configuration Debug  \
-destination \
-archivePath /Users/vsts/Library/Developer/Xcode/Archives/2018-04-16/app-debug\ 2018-04-16\ 09.03.03.xcarchive \
clean \
archive \
CODE_SIGN_IDENTITY=iPhone\ Developer:\ Firstname\ Lastname \ tee /Users/vsts/Library/Logs/gym/app-app-Debug.log 

But the problem is that this command isn't executed and after 60 minutes the CI script aborts because it takes too long. When I used the Xcode task provided by VSTS it will execute xcodebuild command but fail on signing. Here I have the last lines of the VSTS log: https://pastebin.com/wZqRwmJ3

Leon
  • 410
  • 2
  • 14
  • Does the build generate any log for that task? Could you share it here please? If you could add the configuration build task as well it could be usefull – Rodrigo Werlang Apr 17 '18 at 11:34
  • It has no visible output form the task it only waits until 60 minutes expire and then it cancels the build. – Leon Apr 17 '18 at 12:04
  • @RodrigoWerlang you can find the last lines of the log here: https://pastebin.com/wZqRwmJ3 – Leon Apr 17 '18 at 13:16
  • Do you use private agent? What's the result if you call that command manually on build agent machine? Is the agent running as interactive mode or the service mode with your account? If not, try it and check the result. – starian chen-MSFT Apr 18 '18 at 01:53
  • @starianchen-MSFT I used to use a self hosted agent but now I wanted to try to use the 'Hosted Mac OS Preview' agent. Yesterday I tried to use the provided Xcode task and this also fails. So I'm starting to think that the agent has a problem with executing xcodebuild. – Leon Apr 18 '18 at 05:42
  • What's the result if you call that command manually on build agent machine? Is the agent running as interactive mode or the service mode with your account? – starian chen-MSFT Apr 18 '18 at 05:54
  • @starianchen-MSFT There's no result. The only result there's is the timeout VSTS is calling after 60 minutes. And it's a hosted agent so I don't determine the mode it's running in. – Leon Apr 18 '18 at 08:56
  • Can you setup a private agent on your machine? – starian chen-MSFT Apr 19 '18 at 01:58
  • @starianchen-MSFT Yes I have it currently working on a private agent but it's still odd that the vsts Mac preview image doesn't run xcodebuild commands. – Leon Apr 23 '18 at 06:07
  • Do you need to interactive with it after calling the command? Such as prompt a window for confirm and you need to accept it manually? – starian chen-MSFT Apr 23 '18 at 07:14
  • @starianchen-MSFT No, the build should just run xcodebuild. I tried using the built-in option but that also doesn't work. The command just stalls. – Leon Apr 23 '18 at 08:49

1 Answers1

0

You should add this extension to your VSTS environment to enable easier interactions with Fastlane. https://github.com/Microsoft/app-store-vsts-extension

There is extensive documentation in the README that I don't just want to copy and paste here, but basically you install the extension from the Azure DevOps Marketplace, then add it as a "Deploy" step, and configure a couple "secure" environment variables to allow it to login and perform the deploy.

dragon788
  • 3,583
  • 1
  • 40
  • 49
  • It's been a year ago but as far as I can remember the extension had some limitations and that's why I scripted all fastlane scripts. – Leon Mar 29 '19 at 09:33