Capistrano 的 'cap staging deploy' 任务已成功完成,但更改不会出现在登台服务器上
Capistrano's 'cap staging deploy' tasks complete successfully but changes don't appear on staging server
这很令人费解,因为我已经在 运行 'cap staging deploy' 之前正确更新并推送到 GIT 的主分支,但更改不会在登台服务器上呈现。
如果我能提供更多可能有用的信息,请告诉我。
在此先感谢您的帮助。
应用程序也正在成功重启部署:
INFO [907b2583] Running /usr/bin/env touch /var/www/my_app/my_app-stgng/current/tmp/restart.txt as deploy@x.x.x.x
DEBUG [907b2583] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 /usr/bin/env touch /var/www/my_app/my_app-stgng/current/tmp/restart.txt )
INFO [907b2583] Finished in 0.666 seconds with exit status 0 (successful).
编辑:部署脚本设置到正确的分支,但是 /views 中的源代码与本地源代码不匹配。
编辑:正确的来源在 git repo master 分支中。这似乎表明我的部署是从与预期不同的分支中提取的。
编辑:Capistrano 部署日志摘录属于 GIT:
DEBUG Uploading /home/deploy/deploy_tmp/myappme_app/git-ssh.sh 0.0%
INFO Uploading /home/deploy/deploy_tmp/myappme_app/git-ssh.sh 100.0%
INFO [ffabbafb] Running /usr/bin/env chmod +x /home/deploy/deploy_tmp/myappme_app/git-ssh.sh as deploy@x.x.x.x
DEBUG [ffabbafb] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 /usr/bin/env chmod +x /home/deploy/deploy_tmp/myappme_app/git-ssh.sh )
INFO [ffabbafb] Finished in 0.640 seconds with exit status 0 (successful).
INFO [16e6d3cd] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:CryptoWhippet/myappme_app.git as deploy@x.x.x.x
DEBUG [16e6d3cd] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git ls-remote --heads git@bitbucket.org:CryptoWhippet/myappme_app.git )
DEBUG [16e6d3cd] 2cd85c80e2d9b4c33b791c341dd19894 refs/heads/master
INFO [16e6d3cd] Finished in 5.960 seconds with exit status 0 (successful).
[..]
DEBUG [4341e870] Running /usr/bin/env [ -f /var/www/my_app/my_app-stgng/repo/HEAD ] as deploy@x.x.x.x
DEBUG [4341e870] Command: [ -f /var/www/my_app/my_app-stgng/repo/HEAD ]
DEBUG [4341e870] Finished in 0.691 seconds with exit status 0 (successful).
INFO The repository mirror is at /var/www/my_app/my_app-stgng/repo
DEBUG [20a36e89] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy@x.x.x.x
DEBUG [20a36e89] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [20a36e89] Finished in 0.648 seconds with exit status 0 (successful).
INFO [6bb0fabc] Running /usr/bin/env git remote update as deploy@x.x.x.x
DEBUG [6bb0fabc] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git remote update )
DEBUG [6bb0fabc] Fetching origin
INFO [6bb0fabc] Finished in 4.061 seconds with exit status 0 (successful).
DEBUG [bcc4ff25] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy@x.x.x.x
DEBUG [bcc4ff25] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [bcc4ff25] Finished in 0.648 seconds with exit status 0 (successful).
INFO [a3663844] Running /usr/bin/env mkdir -p /var/www/my_app/my_app-stgng/releases/20151209132220 as deploy@x.x.x.x
DEBUG [a3663844] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env mkdir -p /var/www/my_app/my_app-stgng/releases/20151209132220 )
INFO [a3663844] Finished in 0.650 seconds with exit status 0 (successful).
INFO [b2cf939e] Running /usr/bin/env git archive master | tar -x -f - -C /var/www/my_app/my_app-stgng/releases/20151209132220 as deploy@x.x.x.x
DEBUG [b2cf939e] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git archive master | tar -x -f - -C /var/www/my_app/my_app-stgng/releases/20151209132220 )
INFO [b2cf939e] Finished in 3.266 seconds with exit status 0 (successful).
DEBUG [b21a4932] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy@x.x.x.x
DEBUG [b21a4932] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [b21a4932] Finished in 0.646 seconds with exit status 0 (successful).
DEBUG [efdb30ab] Running /usr/bin/env git rev-list --max-count=1 --abbrev-commit master as deploy@x.x.x.x
DEBUG [efdb30ab] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git rev-list --max-count=1 --abbrev-commit master )
DEBUG [efdb30ab] 8b9d346
DEBUG [efdb30ab] Finished in 0.630 seconds with exit status 0 (successful).
你有没有重启服务器?
部署后我们需要做几件事,一旦您部署了代码,我们需要检查服务器,我们需要重新启动服务器实例,以便更改应该出现在您的登台服务器上,希望这个可能对你有帮助。
您可能需要在暂存配置文件中添加一些任务,以便在您想要自动重启时自动重新启动服务器。
after 'deploy:publishing', 'deploy:restart'
sass-rails 的某些版本存在错误,无法在部署时重新编译样式表。您应该首先检查登台服务器上的 git 目录是否与主服务器中的目录相同,然后检查您添加的功能是否正常工作。如果是这样,并且您只有样式表问题或者 javascript 并且您可能需要使用 gem 版本。
要找到可用的 gem 版本,您可以手动更改登台服务器上的 gem 文件,然后使用与 capistrano 用于捆绑和预编译资产的相同命令。
如果没有帮助,请检查(由 capistrano)克隆的存储库镜像以确认它处于与 origin/maser 相同的状态。如果不匹配,并且您确定部署配置中的 git 存储库设置正确,您应该清除存储库目录并重新运行 部署例程。
这很令人费解,因为我已经在 运行 'cap staging deploy' 之前正确更新并推送到 GIT 的主分支,但更改不会在登台服务器上呈现。
如果我能提供更多可能有用的信息,请告诉我。
在此先感谢您的帮助。
应用程序也正在成功重启部署:
INFO [907b2583] Running /usr/bin/env touch /var/www/my_app/my_app-stgng/current/tmp/restart.txt as deploy@x.x.x.x
DEBUG [907b2583] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 /usr/bin/env touch /var/www/my_app/my_app-stgng/current/tmp/restart.txt )
INFO [907b2583] Finished in 0.666 seconds with exit status 0 (successful).
编辑:部署脚本设置到正确的分支,但是 /views 中的源代码与本地源代码不匹配。
编辑:正确的来源在 git repo master 分支中。这似乎表明我的部署是从与预期不同的分支中提取的。
编辑:Capistrano 部署日志摘录属于 GIT:
DEBUG Uploading /home/deploy/deploy_tmp/myappme_app/git-ssh.sh 0.0%
INFO Uploading /home/deploy/deploy_tmp/myappme_app/git-ssh.sh 100.0%
INFO [ffabbafb] Running /usr/bin/env chmod +x /home/deploy/deploy_tmp/myappme_app/git-ssh.sh as deploy@x.x.x.x
DEBUG [ffabbafb] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 /usr/bin/env chmod +x /home/deploy/deploy_tmp/myappme_app/git-ssh.sh )
INFO [ffabbafb] Finished in 0.640 seconds with exit status 0 (successful).
INFO [16e6d3cd] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:CryptoWhippet/myappme_app.git as deploy@x.x.x.x
DEBUG [16e6d3cd] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git ls-remote --heads git@bitbucket.org:CryptoWhippet/myappme_app.git )
DEBUG [16e6d3cd] 2cd85c80e2d9b4c33b791c341dd19894 refs/heads/master
INFO [16e6d3cd] Finished in 5.960 seconds with exit status 0 (successful).
[..]
DEBUG [4341e870] Running /usr/bin/env [ -f /var/www/my_app/my_app-stgng/repo/HEAD ] as deploy@x.x.x.x
DEBUG [4341e870] Command: [ -f /var/www/my_app/my_app-stgng/repo/HEAD ]
DEBUG [4341e870] Finished in 0.691 seconds with exit status 0 (successful).
INFO The repository mirror is at /var/www/my_app/my_app-stgng/repo
DEBUG [20a36e89] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy@x.x.x.x
DEBUG [20a36e89] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [20a36e89] Finished in 0.648 seconds with exit status 0 (successful).
INFO [6bb0fabc] Running /usr/bin/env git remote update as deploy@x.x.x.x
DEBUG [6bb0fabc] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git remote update )
DEBUG [6bb0fabc] Fetching origin
INFO [6bb0fabc] Finished in 4.061 seconds with exit status 0 (successful).
DEBUG [bcc4ff25] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy@x.x.x.x
DEBUG [bcc4ff25] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [bcc4ff25] Finished in 0.648 seconds with exit status 0 (successful).
INFO [a3663844] Running /usr/bin/env mkdir -p /var/www/my_app/my_app-stgng/releases/20151209132220 as deploy@x.x.x.x
DEBUG [a3663844] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env mkdir -p /var/www/my_app/my_app-stgng/releases/20151209132220 )
INFO [a3663844] Finished in 0.650 seconds with exit status 0 (successful).
INFO [b2cf939e] Running /usr/bin/env git archive master | tar -x -f - -C /var/www/my_app/my_app-stgng/releases/20151209132220 as deploy@x.x.x.x
DEBUG [b2cf939e] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git archive master | tar -x -f - -C /var/www/my_app/my_app-stgng/releases/20151209132220 )
INFO [b2cf939e] Finished in 3.266 seconds with exit status 0 (successful).
DEBUG [b21a4932] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy@x.x.x.x
DEBUG [b21a4932] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [b21a4932] Finished in 0.646 seconds with exit status 0 (successful).
DEBUG [efdb30ab] Running /usr/bin/env git rev-list --max-count=1 --abbrev-commit master as deploy@x.x.x.x
DEBUG [efdb30ab] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git rev-list --max-count=1 --abbrev-commit master )
DEBUG [efdb30ab] 8b9d346
DEBUG [efdb30ab] Finished in 0.630 seconds with exit status 0 (successful).
你有没有重启服务器?
部署后我们需要做几件事,一旦您部署了代码,我们需要检查服务器,我们需要重新启动服务器实例,以便更改应该出现在您的登台服务器上,希望这个可能对你有帮助。
您可能需要在暂存配置文件中添加一些任务,以便在您想要自动重启时自动重新启动服务器。
after 'deploy:publishing', 'deploy:restart'
sass-rails 的某些版本存在错误,无法在部署时重新编译样式表。您应该首先检查登台服务器上的 git 目录是否与主服务器中的目录相同,然后检查您添加的功能是否正常工作。如果是这样,并且您只有样式表问题或者 javascript 并且您可能需要使用 gem 版本。
要找到可用的 gem 版本,您可以手动更改登台服务器上的 gem 文件,然后使用与 capistrano 用于捆绑和预编译资产的相同命令。
如果没有帮助,请检查(由 capistrano)克隆的存储库镜像以确认它处于与 origin/maser 相同的状态。如果不匹配,并且您确定部署配置中的 git 存储库设置正确,您应该清除存储库目录并重新运行 部署例程。