Run Script with xCode Server Bot - xcode

I am running a on-commit Bot to build, analyze, unit tes and archive my App and it works perfectly.
I have a script (*.sh) in my porject that I want to run at the end of a success analysis. I am using xcode 7.3 now and i tried the following:
In the trigger section call ./myscript.sh, but the bot could not find it.
I tried to add $SCROOT, still no luck
I tried to copy the script to bin but since the bot runs under that __xcbuild user it did not see it, and I do not want to mess with adding permission to /bin and /usr/bin
All I want is to run a script against the code the that the bot just pulled on success.

The source used by Xcode CI will be under a cache folder stored in an environment variable called:
$XCS_SOURCE_DIR
Your file should be somewhere under that path

Related

Can I force Crashlytics to call a script "run" in the current thread?

I have my own script through which I create a temporary folder for derivedDataPath. as soon as the script works and creates an IPA file, the derivedDataPath folder is deleted. But at the last stage of the build, I added a call:
Script:
${BUILD_DIR%Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run
Input Files:
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
${SRCROOT}/${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}
He informs me that everything is fine and the upload will be completed in the background:
Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Validation succeeded. Symbol uploading will proceed in the background.
But in my IPA file creation script, the derivedDataPath folder will be deleted. Perhaps for this reason, the data is not being uploaded. How can I check the completion of the upload?
Now I have a console hanging in Firebase that there are no dSYM files for the desired version And I don't understand what's wrong with the Update not through the Appstore, but through air.
Instead of using the "run" script, you can call the "upload-symbols" script adding the --build-phase flag:
${BUILD_DIR%Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/upload-symbols --build-phase
This will make the script to upload the dSYMs as part of the build process instead of doing it in the background.

Angular Console: Can't create library

I'm trying to create a new library using v 8.1.0 of the Angular Console on Windows. The error I get is "ENOENT: no such file or directory, mkdir "c:\path\to\my\workspace\libs\new_library_name"
"c:\path\to\my\workspace\libs" exists already
new_library_name folder should be created by Angular Console
The command run by the console is ng generate #nrwl/angular:library new_library_name.
I've tried different names/paths, running as administrator, running inside VSCode and in the standalone console. No luck with anything. This used to work.
Also, if I create the folder c:\path\to\my\workspace\libs\new_library_name and then run the console again, I get an error ENOENT: no such file or directory c:\path\to\my\workspace\libs\new_library_name\ReadMe.md. Of course the ReadMe doesn't exist - it needs to be created by the console.
What am I doing wrong or where to look?
Problem solved. I had turned on Controlled Folder Access in Windows 10 and mistakenly included my project folder as a controlled folder, which prevented applications (Angular Console, Yarn, etc) from writing to the folder. Removed it from Controlled Access and all is working again.

Copying a file before integration using an Xcode Server bot

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

Xcode 6 Continuous Integration Bot - Crashlytics failing on build / upload script

Trying to incorporate Continuous Integration into my Xcode builds.
I have setup OS X Server on my MacBook and everything seems to work fine except for the actual submit/upload script for Crashlytics.
I am getting this error in the 'Trigger' log:
/var/folders/1d/5y5tn0hd1qj01wbxgd3sxrs4000086/T/EFFB7FF5-CFF5-41CF-8AEB-D8813069D831-16127-000004A29A1D79A7: line 2: /Crashlytics.framework/submit: No such file or directory
Couple things to note:
I am able to manually archive/distribute my builds through Crashlytics without any problems.
Crashlytics is installed via PODS and my Run Script looks like this (with my real keys obviously):
${PODS_ROOT}/Crashlytics.framework/submit MYAPIKEY MYCLIENTKEY -emails myEmail#myEmail.com -notesPath ~/Notes/ReleaseNotes.txt -groupAliases myGroupAlias -notifications YES
${PODS_ROOT} is not available to the post trigger action.
You should use
${XCS_SOURCE_DIR}/*RepoName*/Pods/Crashlytics/Crashlytics.framework/submit etc
Where *RepoName* is the name of your repo. Sadly, I haven't been able to find a env variable for it or something.

appcfg.py is not running with cmd prompt (Windows 7)

I am having strange problem. I used to run appcfg.py to update my app to appengine but now its not working anymore. When I run this command
C:\Program Files <x86>\Google\google_appengine>appcfg.py update E:\path\myApp\
Its not giving me anything, no error no feedback. Its just back to this line
C:\Program Files <x86>\Google\google_appengine>
Any idea about this issue!
P.S. I'm using Python 2.7. My code is updating through google app launcher but I need to run it from cmd prompt as I will be downloading/uploading appengine stuff which launcher doesn't allow me to do!
Thanks
I still had a little trouble with the instructions. Here's the steps I used to create a batch file to use the Google App Engine download_app with Windows 7.
In my example,
I'll use drive, C:
Default python path will be, C:\Python27\python.exe
GAE path (include "), "C:\Program Files (x86)\Google\google_appengine\appcfg.py"
App ID {your_app_id} will be just your app-id name
{your_app_version} is the "Version:" number in your GAE app.yaml file
I'll create a folder on my Windows 7 desktop and call it GAE_App
The desktop folder path will be C:\Users\{username}\Desktop\GAE_App
{your email} will be the Gmail account connected to your GAE
Right-click on the desktop and select New->Text Document. Open the newly created text document and add the following line of code modified for your setup to the blank text document,
C:\Python27\python.exe "C:\Program Files (x86)\Google\google_appengine\appcfg.py" download_app -A {your_app_id} -V {your_app_version} --email={your email} C:\Users\{username}\Desktop\GAE_App
Save the text document and change the file name to GAE_Download.bat
It's important that the extension now says ".bat" instead of ".txt"
Once finished, click on the batch to execute it. You'll be asked for a password and then the files should download into the GAE_App folder on your desktop. Now, whenever you need to download your files, just click on the batch file.
Not sure why Google didn't simply include this feature with their GAE for Windows software.
I faced the same issue. Here is a simple solution.
Just do this following Steps:
Go to program file where google app engine is installed. Generally It is named as Google.
click on appcfg.py and select open with.. Select "Choose Default Programs".
Select Python from programs and select "Always Use the selected program to open this kind of file" .
Now run the command you should get the results on command line.
For reference click here
Fixed by accessing python lib like that
C:\Python27>python appcfg.py update E:\path\myApp\
Here's a solution that worked for me:
"google_appengine/appcfg.py" update "C:\PATH TO APP
The appcfg.bat that should be used is located **C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\appengine-java-sdk\bin** and not the empty appcfg.bat that for some unknown reason also was here C:\Program Files\Google\Cloud SDK\
Good practice is to add this path to the system variable PATH
This worked for me
Basis
<PATH_TO_PYTHON>python <PATH_TO_APPCFG.PY>appcfg.py -A <PROJECT_INSTANCE_NAME> update app.yaml
Example
X:\Software\Python2.7\python Q:\SOFTWARE\GoogleAppEngineSDK\appcfg.py -A great-1337 update app.yaml

Resources