Xcode server bot error "Trigger exited with non zero status 2" - xcode

Hey I wanna set up a Xcode server, in order to work properly I need to get the extension "Siren" to get installed before the bot runs and tests the Xcode project.
The problems here is that every time I integrate the bot to test my app it resets my installed Carthage extensions...
I think I need a pre integration script who installs the missing extensions into the bot when it starts.
At the moment I wrote as pre integration script (called "Install dependencies"):
#!/bin/sh
cd /Users/catrobat/Library/Caches/XCSBuilder/Bots/9194b282ad9904370a8be66eb400f02d/Source/Catty
make init
The folder dictionary is where my bot gets created and make init is the command in order to get home-brew to install "Siren" and more in the make file.
But it doesn't work and I get the error "Trigger exited with non-zero status 2"
Does anyone know how to fix this?

Xcode Server exposes XCS_PRIMARY_REPO_DIR which is just what you need:
#!/usr/bin/env bash
set -e
pushd "${XCS_PRIMARY_REPO_DIR}"
make init

Related

How to deploy an Expo/React Native app to iOS Device from Xcode

I'm somewhat new to react native and expo but I've been trying to deploy a test version to my phone but can't figure out how to get it to build.
For some extra context, I built most of it in Expo and then ejected it (yes I know this isn't the best choice but I liked the features Expo provided). I ejected it because I needed NFC support which isn't currently supported in Expo so I added that in manually in Xcode after I ejected.
When I open the Xcode workspace and try to deploy it to my phone I get the following error:
Error: Failed to connect to the packager server. If you did not start this build by running 'react-native run-android', you can start the packager manually by running 'react-native start' in the project directory. (Error: Request to packager server failed: 500)
    at /Users/user/Downloads/honorProj-reactNatveFinal/honorProj/reactNative/ethelontisApp/node_modules/expo-updates/scripts/createManifest.js:40:11
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Command PhaseScriptExecution failed with a nonzero exit code
I know it says run react-native start in the project directory (although I'm not entirely what the at /Users/... is refering too) but what really threw me was that it mentioned react-native run-android which doesn't seem like it should be related at all.
Lastly I'm completely and utterly lost with what Command PhaseScriptExecution is.
Thanks for the help.
I was facing the exact same issue. So I just completed the set up the android development first.
But before doing anything, follow the below steps, it may solves the problem.
Step-1: Open terminal and navigate to your project directory example: cd Your project path.
Step-2: Type npx react-native start
Step-3: If you get any error like "error listen EADDRINUSE: address already in use :::8081"
Then follow step-4 to 6:
Step-4 : type sudo lsof -n -i4TCP:8081 // You will get PID from here
Step-5: type kill -9 PIDvalue
Step-6: Repeat the step 2 and 3 once again
If you will not get any error in step- 2 then type npx react-native run-android
and check if there is any error. If yes, then you have to set up the android development first to make it working - (As of now I found this way, but not sure if anyone can find any better way).
Else Open the code using xcode then clean the build and also clean the build folder then try to run.
Thanks, Hope it will help.

Change Fastlane execution folder while inside a lane

We have a flow where we execute a custom script which copies the project on the desktop before it is signed and submitted.
Now we want to use Fastlane and we were thinking to do the following:
We start the fastlane build process
We execute the custom sh script
We do all the fastlane magic
And I am thinking the following - since my sh script is copying the project on the desktop, how can I continue the fastlane script execution from the copied folder and not the original (source) folder?
Should we start fastlane from our custom script instead?
I don't think fastlane is designed to change its working directory while running. It sets up a ton of environment variables when running and if any of those point to the old location you might be in trouble.
Make two fastlane lanes, one for the old location, one for the new. Then your script looks like this
cd old-location
fastlane old_lane
cp -r old-location new-location
cd new-location
fastlane new_lane
Fastlane is great... for certain tasks. Personally I've had a lot more success treating it as a convenience wrapper for a few specific functions rather than an all-in-one solution, so don't be afraid to break out of it. For example, we only use fastlane for submitting our app, not for building and testing (read more).

Fastlane command not found in XCode bots post build trigger

Here's my script
echo "===================="
echo "MAKE ENTERPRISE IPA"
echo "===================="
pwd
cd "${XCS_PRIMARY_REPO_DIR}/"
pwd
fastlane enterprise
This is what's in the logs
====================
MAKE ENTERPRISE IPA
====================
/Users/XcodeServer/Library/Caches/XCSBuilder/Bots/1fc5d5c4b44f01807859f14cc303b56c/Source
/Users/XcodeServer/Library/Caches/XCSBuilder/Bots/1fc5d5c4b44f01807859f14cc303b56c/Source/ProjectName
/var/folders/rc/28t61gwn3c1bcsn1b360d0h40000gp/T/F389538F-77F0-481A-A413-456C809755D1-22343-000364DDDB596983: line 10: fastlane: command not found
If I march directly to the directory on the build server and go to XCS_PRIMARY_REPO_DIR and type in fastlane enterprise everything works fine. I don't know why it's looking in var/folders for fastlane.
Any help would be greatly appreciated thank you.
I added usr/local/bin to the path. I added the following line before I call fastlane. If anyone knows of a better place to put it. I'm all ears.
export PATH=/usr/local/bin:$PATH
Follow this steps:
Navigate inside the repo. e.g.cd TemplateProject.
Add fastlane command.(Since xcode server can't find the Fastlane command you need to specify path)
To know the path navigate to your project folder from terminal and execute command:
which fastlane
Result will look as:
/Users/yourcomputername/.fastlane/bin/fastlane beta
Now use this to create a post Script command as attached in the image
This now makes xcode server find your fastlane.

How to debug custom Heroku buildpack: release script not being driven

I am developing an Eclipse Virgo buildpack but when I try it with Heroku and push a trivial app, detection fails:
-----> Fetching custom git buildpack... done
! Heroku push rejected, no Cedar-supported app detected
The buildpack's detect script works fine locally in the root directory of the app:
$[...]virgo-buildpack/bin/detect .
Virgo Web
Any tips on how to debug this? I tried having the detect script write to stdout and stderr, but the output doesn't appear under "heroku logs".
I am running Mac OS X 10.8.2, Ruby 1.9.3p374, and gems 1.8.23.
Update: following the first two answers, I used a bash detect script to install the missing gem before driving a detect.rb script. I also changed the buildpack scripts to write to standard output.
The heroku push gets a lot further, but still fails. I can see the compile script exiting, but the release bash script has an echo command right at the start and this does not appear in the output.
So it seems that the release script is not being called.
The output is as follows (# indicates comments to avoid clutter):
-----> Fetching custom git buildpack... done
# detect script enter and exit
Virgo Web app detected
# compile script enter and exit
-----> Discovering process types
Procfile declares types
-> (none)
# detect script enter and exit (again)
Virgo Web -> web
-----> Compiled slug size: 60.4MB
-----> Launching... ! Heroku push rejected, failure releasing code
heroku logs --tail simply shows:
2013-03-06T10:53:48+00:00 heroku[slugc]: Slug compilation started
2013-03-06T10:54:27+00:00 heroku[slugc]: Slug compilation failed: failure releasing code
For a custom buildpack, the detect script doesn't really need to be that complicated because users will be specifying it manually with BUILDPACK_URL anyway. A sophisticated detect script really only makes sense for the default Heroku buildpacks because they need to detect if the buildpack applies for any given app.
If you want to completely punt on detection, you can get away with something like this:
#!/usr/bin/env bash
# bin/detect <build-dir>
echo "Vergo"
exit 0
Once you get that working (and work out any issues with compile and release), you can make it a little more intelligent. For example, you could detect if a certain file pattern exists:
#!/usr/bin/env bash
# bin/detect <build-dir>
if [ -f $1/index.jsp ]; then
echo "Vergo" && exit 0
else
echo "no" && exit 1
fi
Also, speaking of simplicity, it looks like you are basing your buildpack on the Ruby buildpack, which is one of the most complicated ones out there. You may want to take a look at the list of third-party buildpacks to see how most are done in simple bash.
Currnetly there are a few tools to make this much easier.
This build pack https://github.com/kr/heroku-buildpack-inline (A build pack to help construct buildpack)
heroku run bash Is your best friend.
Push your build pack on to the platform using the inline buildpack so that you can get good logging, and use heroku run bash so that you can actaully tinker with your buildpack in the environment that you will be using it in.

Running Expresso TDD in Node.js on Windows

Has anyone been able to get this to work?
Environment:
Windows 7 64-bit
node.js v0.6.7
npm 1.1.0-beta-10
expresso 0.9.2
I've successfully installed via npm from zip download (after modifying package.json to remove node-jscoverage dependence). 'npm ls' lists expresso as installed. After overcoming the problem described here by commenting out the reference to SIGINT, expresso will execute from cmd window. However, when I actually attempt to run test suites, I get a 'Cannot find module' error when it tries to open the first test suite. Any help would be appreciated.
You'll have to install the module locally, too.
Have you considered using mocha? It's supposed to be expresso's successor, written by the same author.

Resources