Capistrano' cap staging deploy'任务成功完成但更改不会出现在登台服务器上

时间:2015-12-10 07:42:30

标签: ruby-on-rails git deployment repository capistrano

这令人困惑,因为我已经正确更新并推送到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).

2 个答案:

答案 0 :(得分:2)

某些版本的sass-rails存在一个错误,它没有在部署时重新编译样式表。您应首先检查登台服务器上的git目录是否与master中的git目录相同,然后检查您添加的功能是否正常。如果是这样,你只有样式表或javascript的问题,你可能需要使用gem版本。

要查找有效的gem版本,您可以在登台服务器上手动更改gemfile,然后使用与capistrano用于捆绑和预编译资产相同的命令。

如果没有帮助,请检查克隆(通过capistrano)存储库镜像以确认它与origin / maser处于相同状态。如果它不匹配,并且您确定部署配置中的git存储库设置是正确的,那么您应该清除存储库目录并重新运行部署例程。

答案 1 :(得分:0)

您是否重启了服务器?

一旦部署了我们需要检查服务器的代码,我们需要在部署后做一些事情,我们需要重新启动服务器实例,以便更改应该出现在您的登台服务器上,希望这可能有所帮助你。

可能需要在登台配置文件中添加一些任务,以便在想要自动重启时自动重新启动服务器。

after 'deploy:publishing', 'deploy:restart'