5

I have a local install of JenkinsCI. Installed via instructions in the Chapter 2 of Jenkins The Definitive Guide. I start Jenkins via Java Web Start/JNLP file on my MAC running El Capitan. All that went great, sample project is working.

I know want to get my Codeception Acceptance test running via Jenkins. I'm following the most recent blog post about this on the Codeception site: http://codeception.com/02-04-2015/setting-up-jenkins-with-codeception.html#.VwWxE2PLRAZ.

Using the Execute shell build step, my build fails with the following message:

Started by user anonymous

Building in workspace /Users/Cosette/.jenkins/workspace/Project Name

[Project Name] $ /bin/sh -xe /var/folders/ns/ly6hv_513tl6qqslrb2vj_dw0000gn/T/hudson9210778078639547082.sh

  • composer install

/var/folders/ns/ly6hv_513tl6qqslrb2vj_dw0000gn/T/hudson9210778078639547082.sh: line 2: composer: command not found

Build step 'Execute shell' marked build as failure

Finished: FAILURE

My guess is that maybe this install type doesn't install the Jenkins user? Please note I am very beginner level and this is my first question here on stackoverflow. Also, That should be a + sign in front of "composer install".

CosetteN
  • 347
  • 1
  • 7
  • 18
  • 1
    you probably need to either a) use the entire path to composer e.g. `/usr/local/bin/composer install` or b) add that path to your `$PATH` environment variable – Jeff Lambert Apr 07 '16 at 14:39
  • I've set up an environmental variable name: composer value: /usr/local/bin/composer. Shouldn't this be the same as giving the entire path? (Which I've also tried, no dice) – CosetteN Apr 07 '16 at 15:55
  • Why set up a separate environment variable just for composer? just modify `$PATH` and add the path to composer to it. Then you should be able to open a new terminal window and type `composer -v` into and get the correct output. Once you can do that your `composer install` should run just fine – Jeff Lambert Apr 07 '16 at 16:50
  • http://stackoverflow.com/questions/11333230/how-to-run-composer-from-anywhere – Jeff Lambert Apr 07 '16 at 16:51
  • I think I'm not explaining myself well. I can run composer -v from any folder in terminal. I believe the problem here is that Jenkins can't access the aliases I've created. – CosetteN Apr 07 '16 at 17:03
  • Have you solved this issue? – John Roca Nov 08 '16 at 03:20
  • I didn't, I'm still implementing the work around listed below. – CosetteN Nov 08 '16 at 14:13

2 Answers2

1

You should download composer from https://getcomposer.org/, rename it to composer, make executable with chmod +x and place somewhere in the PATH of Jenkins.

Konstantin Pelepelin
  • 1,303
  • 1
  • 14
  • 29
  • This doesn't fix the larger issue that Jenkins can't use seem to access any alias. – CosetteN Apr 08 '16 at 16:08
  • 1
    @CosetteN If you mean bash aliases, you may just copy or move composer.phar to composer instead. Bash aliases work only if the command is run using bash, which is not necessary to run composer. – Konstantin Pelepelin Apr 11 '16 at 14:50
0

I have yet to find an answer to ensuring the Jenkins user has access to files under other users. I eventually gave up and installed via homebrew, eliminating the Jenkins user all together. For now I'm just placing everything necessary to run in Users/UserName/.jenkins/Home/workspace/Project-name

CosetteN
  • 347
  • 1
  • 7
  • 18