Deploying Capistrano with rvm and git [git exit fails]

Hello, I have a problem deploying my application. I cannot deploy my application because I have a git release problem

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

      

Does anyone have an idea why this is happening? Maybe it's a problem with rvm or something, I spent a lot of time with this but didn't have time

+3


source to share


1 answer


  • I also had the same problem as you (but my case is expanding to a specific branch) and some are suggesting here Capistrano error: It doesn't look like a tar archive . But he gave two options not suitable for my situation, I don't want to delete my current repo.
  • So after 1 hour to solve the problem, I have a solution:
  • Example:

    • 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 error as 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 bug has been fixed.



0


source







All Articles