Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 970698 - Wrong $WORKSPACE reference for Ruby cartridge using Gemfiles
Wrong $WORKSPACE reference for Ruby cartridge using Gemfiles
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: Hiro Asari
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-06-04 11:51 EDT by Brenton Leanhardt
Modified: 2015-05-14 19:20 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-06-11 00:16:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Brenton Leanhardt 2013-06-04 11:51:31 EDT
Description of problem:
If you create a ruby 1.9 cartridge and include a Gemfile all jenkins builds will fail.  The build log will contain text similar to the following:

rsync: change_dir#3 "/var/lib/openshift/2097a312cd2c11e2b87b22000aa52771///var/lib/openshift/2097a312cd2c11e2b87b22000aa52771/app-root/runtime" failed: No such file or directory (2)

cartridges/openshift-origin-cartridge-ruby/metadata/jenkins_shell_command.erb:9 I believe we need to change ~/$WORKSPACE to $WORKSPACE

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a ruby 1.9 app
2. Add a Gemfile and Gemfile.lock
3. Trigger build
Comment 1 Hiro Asari 2013-06-04 13:28:36 EDT
git push would fail as follows:

remote: Executing Jenkins build.
remote: You can track your build at https://jenkins-fooooooooooo.dev.rhcloud.com/job/rack-build
remote: Waiting for build to schedule.....................................Done
remote: Waiting for job to complete..........................Done
remote: FAILED
remote: !!!!!!!!
remote: Deployment Halted!
remote: If the build failed before the deploy step, your previous
remote: build is still running.  Otherwise, your application may be
remote: partially deployed or inaccessible.
remote: Fix the build and try again.
remote: !!!!!!!!
remote: An error occurred executing 'gear postreceive'
remote: For more details about the problem, try running the command again with the '--trace' option.

The error message shown above would be in, for example, /var/lib/openshift/jenkins-fooooooooooo/app-root/data/jobs/rack-build/builds/lastFailedBuild/log
Comment 2 Hiro Asari 2013-06-04 13:54:19 EDT
https://github.com/openshift/origin-server/pull/2747 fixes this.
Comment 3 openshift-github-bot 2013-06-04 16:25:37 EDT
Commit pushed to master at https://github.com/openshift/origin-server

Bug 970698

Correct rsync's target.
Comment 4 Meng Bo 2013-06-04 23:15:47 EDT
Checked on devenv_3319, issue has been fixed.

Jenkins build for ruby app with Gemfile added will take place in right dir.

Will change the bug status after verify it on devenv-stage ami.
Comment 5 Meng Bo 2013-06-06 06:06:37 EDT
Checked this issue on today's stage (devenv-stage_360), issue fixed.

Tested for both ruby1.9 and ruby1.8 cartridge. Jenkins build for Gemfile added will get successful.

Started by user Jenkins System Builder
Building remotely on 19bldr in workspace /var/lib/openshift/51b05c572587c82c980000b9/app-root/runtime/repo
Checkout:repo / /var/lib/openshift/51b05c572587c82c980000b9/app-root/runtime/repo - hudson.remoting.Channel@1b9f8c3:19bldr
Using strategy: Default
Checkout:repo / /var/lib/openshift/51b05c572587c82c980000b9/app-root/runtime/repo - hudson.remoting.LocalChannel@1ebbd68
Cloning the remote Git repository
Cloning repository origin
Fetching upstream changes from ssh://51b05b9cdbd93c97680000ed@19-bmengstg.stg.rhcloud.com/~/git/19.git
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision 94e7cc8fc8289697aaae12fcc3aff9f18130c568 (origin/HEAD, origin/master)
Checking out Revision 94e7cc8fc8289697aaae12fcc3aff9f18130c568 (origin/HEAD, origin/master)
No change to record in branch origin/HEAD
No change to record in branch origin/master
[repo] $ /bin/sh -xe /tmp/hudson6404270025111002854.sh
+ alias 'rsync=rsync --delete-after -azO -e '\''/usr/libexec/openshift/cartridges/v2/jenkins/bin/git_ssh_wrapper.sh'\'''
+ upstream_ssh=51b05b9cdbd93c97680000ed@19-bmengstg.stg.rhcloud.com
+ '[' -f Gemfile ']'
+ '[' '!' -f .openshift/markers/force_clean_build ']'
+ '[' -d .bundle ']'
+ git show master~1:.bundle
+ rsync --delete-after -azO -e /usr/libexec/openshift/cartridges/v2/jenkins/bin/git_ssh_wrapper.sh --include=.bundle/ '--include=.bundle/***' --include=vendor/ '--include=vendor/***' '--exclude=*' '51b05b9cdbd93c97680000ed@19-bmengstg.stg.rhcloud.com:~/app-root/repo/' /var/lib/openshift/51b05c572587c82c980000b9/app-root/runtime/repo
+ gear build
Running build on Ruby cart
Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
Fetching gem metadata from https://rubygems.org/..
Installing archive-tar-minitar (0.5.2) 
Using bundler (1.1.4) 
Your bundle is complete! It was installed into ./vendor/bundle
+ /usr/libexec/openshift/cartridges/v2/jenkins/bin/git_ssh_wrapper.sh 51b05b9cdbd93c97680000ed@19-bmengstg.stg.rhcloud.com 'gear stop --conditional'
Stopping gear...
Stopping Ruby cart
Waiting for stop to finish
+ rsync --delete-after -azO -e /usr/libexec/openshift/cartridges/v2/jenkins/bin/git_ssh_wrapper.sh /var/lib/openshift/51b05c572587c82c980000b9/app-root/runtime/repo/ '51b05b9cdbd93c97680000ed@19-bmengstg.stg.rhcloud.com:${OPENSHIFT_REPO_DIR}'
+ /usr/libexec/openshift/cartridges/v2/jenkins/bin/git_ssh_wrapper.sh 51b05b9cdbd93c97680000ed@19-bmengstg.stg.rhcloud.com 'gear remotedeploy'
Starting Ruby cart
Archiving artifacts
Finished: SUCCESS

Note You need to log in before you can comment on or make changes to this bug.