1
我試圖部署Capistrano的另一個分支。部署主分支工作正常,但我的「丹尼爾」分支失敗,出現以下錯誤:分支部署失敗 - 不是有效的對象名稱
INFO[e8d2a50d] Running /usr/bin/env git archive daniel | tar -x -C /data/apps/dimsum.staging/releases/20150922073756 on <ip number>
DEBUG[e8d2a50d] Command: cd /data/apps/dimsum.staging/repo && (GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/dimsum.staging/git-ssh.sh /usr/bin/env git archive daniel | tar -x -C /data/apps/dimsum.staging/releases/20150922073756)
DEBUG[e8d2a50d] fatal: Not a valid object name
DEBUG[e8d2a50d] tar: This does not look like a tar archive
DEBUG[e8d2a50d] tar: Exiting with failure status due to previous errors
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host <ip number>: git exit status: 2
git stdout: Nothing written
git stderr: fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
這是我的部署文件:
#deploy.rb
set :application, 'dimsum_v2'
set :repo_url, '[email protected].org:<git repo>.git'
#staging.rb
set :stage, :staging
set :application, "dimsum.staging"
set :app_path, "/data/apps/#{fetch(:application)}"
set :branch, 'daniel'
set :deploy_to, fetch(:app_path)
server '<ip number>', user: 'deploy', roles: %w{web app}, my_property: :my_value
直接在服務器的工作原理克隆大師和丹尼爾分支也很好。例如:
git clone -b daniel [email protected]:<git repo>.git
可能是什麼問題?
我發現這裏的另一個臨時的解決方案,我會嘗試刪除以後像你建議的文件夾中。 –