Reputation: 569
So, when I attempt to run a script file in a TeamCity build step (Command line build step) I get the following error:
Step 1/8: Download provisioning profile (script file) (Command Line)
[12:23:07][Step 1/8] Starting: /Applications/TeamCity/buildAgent/work/83a21295522e711a/TeamCityCustomBuildScripts/DownloadProvisioningProfile.sh
[12:23:07][Step 1/8] in directory: /Applications/TeamCity/buildAgent/work/83a21295522e711a/Project
[12:23:07][Step 1/8] Cannot run process /Applications/TeamCity/buildAgent/work/83a21295522e711a/TeamCityCustomBuildScripts/DownloadProvisioningProfile.sh : file not found
[12:23:07][Step 1/8] Step Download provisioning profile (script file) (Command Line) failed with unexpected error
I can find and run the script manually at the exact place the build step tells me it can not find it.
What could be wrong here?
Upvotes: 6
Views: 4744
Reputation: 569
It was apparently line endings.
I had created the .sh file on windows with the #!/bin/bash
shebang in the first line but the interpreter could not be found since the line was not terminated properly.
The solution was changing the line endings on my windows machine (using Notepad++ Edit -> EOL Conversion -> Unix LF)
Upvotes: 0
Reputation: 7903
As commented, this appears to be a permission problem. Either on the file itself, or on one of the directories.
Which user does the teamcity agent run as?
Does that user have full access to the desired location?
Change the permissions so that the agent has access to the script and it should work.
Upvotes: 1