How do I invoke a build script after downloading from git

asked 2016-04-04 13:12:09 -0600

alex.barylski gravatar image

Here is the code:

exec { "Download Phalcon":
    path => ["/usr/bin/", "/home/cphalcon/build"],
    command => "git clone git://github.com/phalcon/cphalcon.git /home/cphalcon",
    require => [Package["git"], Package["php5-fpm"]]
}

exec { "Build Phalcon":
    require => Exec["Download Phalcon"],
    command => "./install",
#    creates => "/home/cphalcon/build",
    cwd => "/home/cphalcon/build",
    path => ["/usr/bin", "/home/cphalcon/build"]
}

Here are the errors:

==> default: Error: ./install: line 38: rm: command not found
==> default: ./install: line 64: phpize: command not found
==> default: Error: /Stage[main]/Main/Exec[Build Phalcon]/returns: change from notrun to 0 failed: ./install: line 38: rm: command not found
==> default: ./install: line 64: phpize: command not found

Any ideas? phpize is not missing when I manually invoke ./install from the CLI - why would it be missing now?

edit retag flag offensive close merge delete

Comments

Seems like the `./install` script is not specifying the full path to the `rm` and `phpsize` commands. Maybe you need to add one more directory to your `path =>` attribute.

Red Cricket gravatar imageRed Cricket ( 2016-04-04 17:49:59 -0600 )edit

But phpize and rm are inside the /usr/bin - which I do include in the 'path'???

alex.barylski gravatar imagealex.barylski ( 2016-04-04 21:42:25 -0600 )edit

You should use absolute paths in your install script. The path will not get passed to the install script. It's a good practice to use always absolute paths in subshells !

FranzCC gravatar imageFranzCC ( 2016-04-05 03:29:21 -0600 )edit