I'm setting up a continuous integration (CI) server for our iOS app using Xcode Server. The problem is we have a plist, cred.plist
for each person with their credentials and test environment details that is ignored by git and the application will not compile and run without it. There is a file cred_dist.plist
that is used to update cred.plist
that will work for our CI purposes and I would like to rename/copy it before integration and name it "cred.plist". Both files in the project are in the root directory.
I have tried adding scripts to the CI target and to the bot itself to no avail. Below is an example of an attempt from the bot "Before Integration" script section as well as the error message I receive. I have tried nearly every directory variable I could find including the XCS_
prefix ones, just a slash, and no prefix.
The bot successfully pulls the code from our repo and builds up to the point that the plist is required, then errors.
Any suggestions or help would be greatly appreciated! Thanks!
Script:
#! /bin/bash
cp -a $(TMPDIR)/cred_dist.plist $(TMPDIR)/cred.plist
Error:
Assertion: Reading data: The file cred.plist” couldn’t be opened because there is no such file.
File: MyProject/cred.plist:(null)
After a bit of digging, trial and error, and testing, I believe I have arrived at a solution. The problem is that the XCS_
prefix variable that is closest is XCS_SOURCE_DIR
, but that points to where the project is cloned... This means that the path should actually be ${XCS_SOURCE_DIR}/myproject/cred_dist.plist
. Below is the script I'm using to perform this task; it runs before the integration - hopefully it will be helpful to someone!
#! /bin/bash
cp -a ${XCS_SOURCE_DIR}/myproject/cred_dist.plist ${XCS_SOURCE_DIR}/myproject/cred.plist