简体   繁体   中英

Capistrano deploy with rvm and git [git release fail]

Hello I have problem with deploy my app. I can't deploy my application because I have problem with git release

DEBUG[53fd915c] Finished in 2.573 seconds with exit status 0 (successful).
INFO[545c6125] Running /usr/bin/env mkdir -pv ~/deploy/shared ~/deploy/releases on
DEBUG[545c6125] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared ~/deploy/releases )
INFO[545c6125] Finished in 0.042 seconds with exit status 0 (successful).
INFO[021eadb4] Running /usr/bin/env mkdir -pv ~/deploy/shared/bin ~/deploy/shared/log ~/deploy/shared/tmp/pids ~/deploy/shared/tmp/cache ~/deploy/shared/tmp/sockets ~/deploy/shared/vendor/bundle ~/deploy/shared/public/system on    DEBUG[021eadb4] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared/bin ~/deploy/shared/log ~/deploy/shared/tmp/pids ~/deploy/shared/tmp/cache ~/deploy/shared/tmp/sockets ~/deploy/shared/vendor/bundle ~/deploy/shared/public/system )
INFO[021eadb4] Finished in 0.040 seconds with exit status 0 (successful).
INFO[c4cc4af5] Running /usr/bin/env mkdir -pv ~/deploy/shared/config on     DEBUG[c4cc4af5] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared/config )
INFO[c4cc4af5] Finished in 0.038 seconds with exit status 0 (successful).
DEBUG[c231d0c7] Running /usr/bin/env [ -f ~/deploy/shared/config/database.yml ] on    DEBUG[c231d0c7] Command: [ -f ~/deploy/shared/config/database.yml ]
DEBUG[c231d0c7] Finished in 0.032 seconds with exit status 0 (successful).
DEBUG[b42c9ef2] Running /usr/bin/env [ -f ~/deploy/current/REVISION ] on     DEBUG[b42c9ef2] Command: [ -f ~/deploy/current/REVISION ]
DEBUG[b42c9ef2] Finished in 0.031 seconds with exit status 1 (failed).
DEBUG[9f6e7e95] Running /usr/bin/env [ -f ~/deploy/repo/HEAD ] on 
DEBUG[9f6e7e95] Command: [ -f ~/deploy/repo/HEAD ]
DEBUG[9f6e7e95] Finished in 0.031 seconds with exit status 0 (successful).
INFOThe repository mirror is at ~/deploy/repo
DEBUG[2c4a5ab1] Running /usr/bin/env if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi on
DEBUG[2c4a5ab1] Command: if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi
DEBUG[2c4a5ab1] Finished in 0.029 seconds with exit status 0 (successful).
INFO[ba7cef28] Running /usr/bin/env git remote update on
DEBUG[ba7cef28] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env git remote update )
INFO[ba7cef28] Finished in 0.038 seconds with exit status 0 (successful).
DEBUG[f0098e08] Running /usr/bin/env if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi on
DEBUG[f0098e08] Command: if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi
DEBUG[f0098e08] Finished in 0.031 seconds with exit status 0 (successful).
INFO[4b4fe200] Running /usr/bin/env mkdir -p ~/deploy/releases/20140805094710 on
DEBUG[4b4fe200] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env mkdir -p ~/deploy/releases/20140805094710 )
INFO[4b4fe200] Finished in 0.038 seconds with exit status 0 (successful).
INFO[1bd3716b] Running /usr/bin/env git archive master | tar -x -C ~/deploy/releases/20140805094710 on
DEBUG[1bd3716b] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env git archive master | tar -x -C ~/deploy/releases/20140805094710 )
DEBUG[1bd3716b]     fatal: Not a valid object name
DEBUG[1bd3716b]     tar: This does not look like a tar archive
DEBUG[1bd3716b]     tar: Exiting with failure status due to previous errors
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host : git exit status: 2
git stdout: Nothing written
git stderr: Nothing written

Anyone have idea why it happen? Maybe it's a problem with rvm or something, I spent with this a lot of time but no success

  • I also got the same issue like you (but my case is deploy to specific branch), and some one suggest here Capistrano error tar: This does not look like a tar archive . But he gave 2 options that should not suitable to my situation, I don't want to delete my current repo.
  • So after 1 hour to workaround, I have a solution:
  • Ex:

    • before: (deploy/production.rb)

       set :branch, ENV["BRANCH_NAME"] || "master" (I stay at master branch then run command) BRANCH_NAME=another_branch_name cap production deploy 

      then I get an error like above

    • after: (deploy/production.rb)

       set :branch, `git rev-parse --abbrev-ref HEAD`.chomp (I stay at another_branch_name then run command) cap production deploy 

      the error was fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM