Description of problem: After created a drupal app, I enabled jenkins to the app. But when I tried to build the drupal app on Jenkins server , I found the app would always be built failed. Have tried to create drupal via website and CLI (rhc app create drupal php-5.3 mysql-5.1 cron --from-code=git://github.com/openshift/drupal-quickstart.git -k ), both of these drupal apps built failed on Jenkins server. Version-Release number of selected component (if applicable): devenv_2968, STG, PROD How reproducible: always Steps to Reproduce: 1.Create a drupal app via website 2.Enable jenkins to the app 3.Build drupal on Jenkins server Actual results: Build failed with console output as follows: ____________________________________________________________ Started by user Jenkins Admin Building remotely on drupalbldr in workspace php-5.3/ci/jenkins/workspace/drupal-build Checkout:drupal-build / php-5.3/ci/jenkins/workspace/drupal-build - hudson.remoting.Channel@d78744:drupalbldr Using strategy: Default Checkout:drupal-build / php-5.3/ci/jenkins/workspace/drupal-build - hudson.remoting.LocalChannel@12fd192 Cloning the remote Git repository Cloning repository origin Fetching upstream changes from ssh://51498b93c80946372c00006d.rhcloud.com/~/git/drupal.git/ Seen branch in repository origin/HEAD Seen branch in repository origin/master Commencing build of Revision e755b504c78766f46e223bdb6bc33a0e865d104a (origin/HEAD, origin/master) Checking out Revision e755b504c78766f46e223bdb6bc33a0e865d104a (origin/HEAD, origin/master) No change to record in branch origin/HEAD No change to record in branch origin/master [drupal-build] $ /bin/sh -xe /tmp/hudson5748909743022234880.sh + source /usr/libexec/openshift/cartridges/abstract/info/lib/jenkins_util + alias 'rsync=rsync --delete-after -az -e '\''/usr/libexec/openshift/cartridges/jenkins-1.4/info/bin/git_ssh_wrapper.sh'\''' + rsync --delete-after -az -e /usr/libexec/openshift/cartridges/jenkins-1.4/info/bin/git_ssh_wrapper.sh '51498b93c80946372c00006d.rhcloud.com:~/php-5.3/phplib/' /var/lib/openshift/51498d4ac80946cdb20000b5//php-5.3/phplib/ + . ci_build.sh ++ set +x Running .openshift/action_hooks/pre_build Checking pear: pear.drush.org/drush Nothing to upgrade Running .openshift/action_hooks/build Run '. ${OPENSHIFT_DATA_DIR}.bash_profile' to load Drush into your SSH shell. Download and install the latest stable version of Drupal Could not open input file: /var/lib/openshift/51498b93c80946372c00006d/php-5.3/phplib/pear/pear/php/drush/drush.php ERROR: Unable download and install Drupal. Build step 'Execute shell' marked build as failure Archiving artifacts Finished: FAILURE ___________________________________________________________________________ Expected results: The new created drupal app should be built successfully on Jenkins server Additional info:
Why would the jenkins builder gear be different w.r.t Pear paths?
We could be probably missing the ~/.pearrc settings file on the Jenkins server. https://github.com/VojtechVitek/origin-server/commit/e75e66e3c9a693bd03590a9327909f7304b713fd I'm testing the changes right now..
Could not open input file: /var/lib/openshift/51498b93c80946372c00006d/php-5.3/phplib/pear/pear/php/drush/drush.php We are looking for this file on the source gear as opposed to on the builder gear. We need to fix the quickstart to prevent the hard-coding that makes us look at the wrong location.
I found out what the problem was: When we build the PEARs on the gear, the absolute path of the gear can get harcoded into the source codes of the libraries (usually .php files) during it's installation. This was the case of the "./php-5.3/phplib/pear/pear/drush" library pointing to the wrong drush.php file (the absolute path was pointing to a different gear). So when we rsync the PEARs from the PHP gear to the Jenkins builder gear (or vice versa, when we pull the changes back from Jenkins), the PEARs might get broken in the context of destination gear.
Seems like we must build the phplibs/ on both Jenkins builder and other PHP gear. This should solve the wrong PATH issues. On the other hand, it would slow down the build phase on the PHP gear itself..
https://github.com/openshift/origin-server/pull/2101 https://github.com/openshift/drupal-quickstart/pull/3
FutureFeature We'd need to find more clear solution in the PEAR installation process to prevent any gear-specific hard-coded stuff in the binaries/libraries. This would let us rsync the PEARs among gears.
Moved to Trello: https://trello.com/c/HOKvYxdJ/224-3-allow-php-pear-to-work-with-jenkins