Capistrano 3.4.0,未部署repo文件夹

时间:2015-08-24 20:19:31

标签: deployment capistrano capistrano3

我目前正在为我的PHP项目设置另一个临时服务器。我有一个工作的,非常简单的第3章部署运行,除了使用默认部署和最后一些整理之外什么都不做。

由于某种原因,部署到新服务器不起作用。它只是省略了创建一个存储库镜像,所以一切都有效,除了获取版本,因为没有可以从中获取的repo文件夹。它只打印无法找到的文件夹“repo”,但仍在继续。

您是否知道如何对其进行故障排除? 我错过了什么?我刚刚复制了工作阶段文件并调整了凭据和服务器数据。当设置日志记录到调试时,我可以看到它从远程读取这是最新版本,但从未尝试过设置本地镜像。

我觉得我错过了一些东西,但是没有部署:设置或者我事先可以执行的东西。

干杯并感谢您的帮助:)

<iframe src='my.php' frameborder='0'
width='100%' height='50' allowtransparency='true'></iframe> 

deploy.rb(从上面的调试输出中清除我的自定义挂钩)

** Invoke mystage (first_time)
** Execute mystage
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
INFO [bceb88e7] Running /usr/bin/env mkdir -p /tmp/appname/ as username@ipaddress
DEBUG [bceb88e7] Command: /usr/bin/env mkdir -p /tmp/appname/
INFO [bceb88e7] Finished in 1.370 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/appname/git-ssh.sh 0.0%
INFO Uploading /tmp/appname/git-ssh.sh 100.0%
INFO [136ce820] Running /usr/bin/env chmod +x /tmp/appname/git-ssh.sh as username@ipaddress
DEBUG [136ce820] Command: /usr/bin/env chmod +x /tmp/appname/git-ssh.sh
INFO [136ce820] Finished in 1.229 seconds with exit status 0 (successful).
** Execute git:check
INFO [108b4d67] Running /usr/bin/env git ls-remote --heads git@gitlab.domain.com:arnekolja/appname.git as username@ipaddress
DEBUG [108b4d67] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/appname/git-ssh.sh /usr/bin/env git ls-remote --heads git@gitlab.domain.com:arnekolja/appname.git )
DEBUG [108b4d67]    24bd500d547c80fc6e3af59a1d3f9cd8579a07b2    refs/heads/master
INFO [108b4d67] Finished in 2.120 seconds with exit status 0 (successful).
** Invoke deploy:check:directories (first_time)
** Execute deploy:check:directories
INFO [f513d3e7] Running /usr/bin/env mkdir -p /username/www.domain.com/shared /username/www.domain.com/releases as username@ipaddress
DEBUG [f513d3e7] Command: /usr/bin/env mkdir -p /username/www.domain.com/shared /username/www.domain.com/releases
INFO [f513d3e7] Finished in 1.222 seconds with exit status 0 (successful).
** Invoke deploy:check:linked_dirs (first_time)
** Execute deploy:check:linked_dirs
INFO [cbae6cba] Running /usr/bin/env mkdir -p /username/www.domain.com/shared/fileadmin /username/www.domain.com/shared/typo3temp /username/www.domain.com/shared/uploads as username@ipaddress
DEBUG [cbae6cba] Command: /usr/bin/env mkdir -p /username/www.domain.com/shared/fileadmin /username/www.domain.com/shared/typo3temp /username/www.domain.com/shared/uploads
INFO [cbae6cba] Finished in 1.226 seconds with exit status 0 (successful).
** Invoke deploy:check:make_linked_dirs (first_time)
** Execute deploy:check:make_linked_dirs
** Invoke deploy:check:linked_files (first_time)
** Execute deploy:check:linked_files
** Invoke deploy:set_previous_revision (first_time)
** Execute deploy:set_previous_revision
DEBUG [2ea98912] Running /usr/bin/env [ -f /username/www.domain.com/current/REVISION ] as username@ipaddress
DEBUG [2ea98912] Command: [ -f /username/www.domain.com/current/REVISION ]
DEBUG [2ea98912] Finished in 1.229 seconds with exit status 0 (successful).
DEBUG [5ccb8dbf] Running /usr/bin/env cat /username/www.domain.com/current/REVISION 2>/dev/null as username@ipaddress
DEBUG [5ccb8dbf] Command: /usr/bin/env cat /username/www.domain.com/current/REVISION 2>/dev/null
DEBUG [5ccb8dbf] Finished in 1.229 seconds with exit status 0 (successful).
** Invoke deploy:started (first_time)
** Execute deploy:started
** Invoke deploy:updating (first_time)
** Invoke deploy:new_release_path (first_time)
** Execute deploy:new_release_path
** Execute deploy:updating
** Invoke git:create_release (first_time)
** Invoke git:update (first_time)
** Invoke git:clone (first_time)
** Invoke git:wrapper 
** Execute git:clone
DEBUG [ed6bb904] Running /usr/bin/env [ -f /username/www.domain.com/repo/HEAD ] as username@ipaddress
DEBUG [ed6bb904] Command: [ -f /username/www.domain.com/repo/HEAD ]
DEBUG [ed6bb904] Finished in 1.219 seconds with exit status 0 (successful).
INFO The repository mirror is at /username/www.domain.com/repo
** Execute git:update
DEBUG [a62aadce] Running /usr/bin/env if test ! -d /username/www.domain.com/repo; then echo "Directory does not exist '/username/www.domain.com/repo'" 1>&2; false; fi as username@ipaddress
DEBUG [a62aadce] Command: if test ! -d /username/www.domain.com/repo; then echo "Directory does not exist '/username/www.domain.com/repo'" 1>&2; false; fi
DEBUG [a62aadce]    Directory does not exist '/username/www.domain.com/repo'
DEBUG [a62aadce] Finished in 1.225 seconds with exit status 0 (successful).
INFO [24f065b3] Running /usr/bin/env git remote update as username@ipaddress
DEBUG [24f065b3] Command: cd /username/www.domain.com/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/appname/git-ssh.sh /usr/bin/env git remote update )
DEBUG [24f065b3]    shell: line 0: cd: /username/www.domain.com/repo: No such file or directory
INFO [24f065b3] Finished in 1.288 seconds with exit status 0 (successful).
** Execute git:create_release
DEBUG [bbc9e0f5] Running /usr/bin/env if test ! -d /username/www.domain.com/repo; then echo "Directory does not exist '/username/www.domain.com/repo'" 1>&2; false; fi as username@ipaddress
DEBUG [bbc9e0f5] Command: if test ! -d /username/www.domain.com/repo; then echo "Directory does not exist '/username/www.domain.com/repo'" 1>&2; false; fi
DEBUG [bbc9e0f5]    Directory does not exist '/username/www.domain.com/repo'
DEBUG [bbc9e0f5] Finished in 1.471 seconds with exit status 0 (successful).
INFO [c79a9ebf] Running /usr/bin/env mkdir -p /username/www.domain.com/releases/20150824184523 as username@ipaddress
DEBUG [c79a9ebf] Command: cd /username/www.domain.com/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/appname/git-ssh.sh /usr/bin/env mkdir -p /username/www.domain.com/releases/20150824184523 )
DEBUG [c79a9ebf]    shell: line 0: cd: /username/www.domain.com/repo: No such file or directory
INFO [c79a9ebf] Finished in 1.226 seconds with exit status 0 (successful).
INFO [1761463a] Running /usr/bin/env git archive master | tar -x -f - -C /username/www.domain.com/releases/20150824184523 as username@ipaddress
DEBUG [1761463a] Command: cd /username/www.domain.com/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/appname/git-ssh.sh /usr/bin/env git archive master | tar -x -f - -C /username/www.domain.com/releases/20150824184523 )
DEBUG [1761463a]    shell: line 0: cd: /username/www.domain.com/repo: No such file or directory
INFO [1761463a] Finished in 1.111 seconds with exit status 0 (successful).
** Invoke deploy:set_current_revision (first_time)
** Execute deploy:set_current_revision
** Invoke git:set_current_revision (first_time)
** Execute git:set_current_revision
DEBUG [75e5e6d4] Running /usr/bin/env if test ! -d /username/www.domain.com/repo; then echo "Directory does not exist '/username/www.domain.com/repo'" 1>&2; false; fi as username@ipaddress
DEBUG [75e5e6d4] Command: if test ! -d /username/www.domain.com/repo; then echo "Directory does not exist '/username/www.domain.com/repo'" 1>&2; false; fi
DEBUG [75e5e6d4]    Directory does not exist '/username/www.domain.com/repo'
DEBUG [75e5e6d4] Finished in 1.342 seconds with exit status 0 (successful).
DEBUG [591e17b8] Running /usr/bin/env git rev-list --max-count=1 --abbrev-commit master as username@ipaddress
DEBUG [591e17b8] Command: cd /username/www.domain.com/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/appname/git-ssh.sh /usr/bin/env git rev-list --max-count=1 --abbrev-commit master )
DEBUG [591e17b8]    shell: line 0: cd: /username/www.domain.com/repo: No such file or directory
DEBUG [591e17b8] Finished in 1.227 seconds with exit status 0 (successful).
DEBUG [af0b741e] Running /usr/bin/env if test ! -d /username/www.domain.com/releases/20150824184523; then echo "Directory does not exist '/username/www.domain.com/releases/20150824184523'" 1>&2; false; fi as username@ipaddress
DEBUG [af0b741e] Command: if test ! -d /username/www.domain.com/releases/20150824184523; then echo "Directory does not exist '/username/www.domain.com/releases/20150824184523'" 1>&2; false; fi
DEBUG [af0b741e]    Directory does not exist '/username/www.domain.com/releases/20150824184523'
DEBUG [af0b741e] Finished in 1.226 seconds with exit status 0 (successful).
INFO [1a7a9f89] Running /usr/bin/env echo "" >> REVISION as username@ipaddress
DEBUG [1a7a9f89] Command: cd /username/www.domain.com/releases/20150824184523 && /usr/bin/env echo "" >> REVISION
DEBUG [1a7a9f89]    shell: line 0: cd: /username/www.domain.com/releases/20150824184523: No such file or directory
INFO [1a7a9f89] Finished in 1.275 seconds with exit status 0 (successful).
** Invoke deploy:symlink:shared (first_time)
** Execute deploy:symlink:shared
** Invoke deploy:symlink:linked_files (first_time)
** Execute deploy:symlink:linked_files
** Invoke deploy:symlink:linked_dirs (first_time)
** Execute deploy:symlink:linked_dirs
INFO [9631b1e2] Running /usr/bin/env mkdir -p /username/www.domain.com/releases/20150824184523 /username/www.domain.com/releases/20150824184523 /username/www.domain.com/releases/20150824184523 as username@ipaddress
DEBUG [9631b1e2] Command: /usr/bin/env mkdir -p /username/www.domain.com/releases/20150824184523 /username/www.domain.com/releases/20150824184523 /username/www.domain.com/releases/20150824184523
INFO [9631b1e2] Finished in 1.183 seconds with exit status 0 (successful).
DEBUG [128c1b78] Running /usr/bin/env [ -L /username/www.domain.com/releases/20150824184523/fileadmin ] as username@ipaddress
DEBUG [128c1b78] Command: [ -L /username/www.domain.com/releases/20150824184523/fileadmin ]
DEBUG [128c1b78] Finished in 1.221 seconds with exit status 0 (successful).
DEBUG [647f61de] Running /usr/bin/env [ -L /username/www.domain.com/releases/20150824184523/typo3temp ] as username@ipaddress
DEBUG [647f61de] Command: [ -L /username/www.domain.com/releases/20150824184523/typo3temp ]
DEBUG [647f61de] Finished in 1.226 seconds with exit status 0 (successful).
DEBUG [eda585b8] Running /usr/bin/env [ -L /username/www.domain.com/releases/20150824184523/uploads ] as username@ipaddress
DEBUG [eda585b8] Command: [ -L /username/www.domain.com/releases/20150824184523/uploads ]
DEBUG [eda585b8] Finished in 1.226 seconds with exit status 0 (successful).
** Invoke deploy:updated (first_time)
** Execute deploy:updated
** Invoke deploy:publishing (first_time)
** Execute deploy:publishing
** Invoke deploy:symlink:release (first_time)
** Execute deploy:symlink:release
INFO [3216ea2a] Running /usr/bin/env ln -s /username/www.domain.com/releases/20150824184523 /username/www.domain.com/releases/current as username@ipaddress
DEBUG [3216ea2a] Command: /usr/bin/env ln -s /username/www.domain.com/releases/20150824184523 /username/www.domain.com/releases/current
INFO [3216ea2a] Finished in 1.224 seconds with exit status 0 (successful).
INFO [4dffab11] Running /usr/bin/env mv /username/www.domain.com/releases/current /username/www.domain.com as username@ipaddress
DEBUG [4dffab11] Command: /usr/bin/env mv /username/www.domain.com/releases/current /username/www.domain.com
INFO [4dffab11] Finished in 1.105 seconds with exit status 0 (successful).
** Invoke deploy:published (first_time)
** Execute deploy:published
** Invoke deploy:finishing (first_time)
** Execute deploy:finishing
** Invoke deploy:cleanup (first_time)
** Execute deploy:cleanup
DEBUG [cff18115] Running /usr/bin/env ls -xtr /username/www.domain.com/releases as username@ipaddress
DEBUG [cff18115] Command: /usr/bin/env ls -xtr /username/www.domain.com/releases
DEBUG [cff18115]    20150824180444  20150824182922  20150824183624  20150824184523
DEBUG [cff18115] Finished in 1.347 seconds with exit status 0 (successful).
INFO Keeping 3 of 4 deployed releases on ipaddress
INFO [efc5b837] Running /usr/bin/env rm -rf /username/www.domain.com/releases/20150824180444 as username@ipaddress
DEBUG [efc5b837] Command: /usr/bin/env rm -rf /username/www.domain.com/releases/20150824180444
INFO [efc5b837] Finished in 1.123 seconds with exit status 0 (successful).
** Invoke deploy:notify (first_time)
** Execute deploy:notify
** Invoke deploy:finished (first_time)
** Execute deploy:finished
** Invoke deploy:log_revision (first_time)
** Execute deploy:log_revision
DEBUG [c571276a] Running /usr/bin/env if test ! -d /username/www.domain.com/releases; then echo "Directory does not exist '/username/www.domain.com/releases'" 1>&2; false; fi as username@ipaddress
DEBUG [c571276a] Command: if test ! -d /username/www.domain.com/releases; then echo "Directory does not exist '/username/www.domain.com/releases'" 1>&2; false; fi
DEBUG [c571276a] Finished in 1.372 seconds with exit status 0 (successful).
INFO [964a1750] Running /usr/bin/env echo "Branch master (at ) deployed as release 20150824184523 by arne" >> /username/www.domain.com/revisions.log as username@ipaddress
DEBUG [964a1750] Command: echo "Branch master (at ) deployed as release 20150824184523 by arne" >> /username/www.domain.com/revisions.log
INFO [964a1750] Finished in 1.096 seconds with exit status 0 (successful).
Arne-Koljas-MacBook-Air:appname.local arne$ 

mystage.rb:

lock '3.4.0'
set :application, 'appname'
set :repo_url, 'git@gitlab.domain.com:arnekolja/appname.git'
set :scm, :git
set :log_level, :debug
set :linked_dirs, fetch(:linked_dirs, []).push('fileadmin', 'typo3temp', 'uploads')
set :keep_releases, 3

namespace :deploy do

  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      # nothing here yet
    end
  end

  after :finishing, :notify do
    on roles(:web) do
      if test("[ -d #{shared_path}/typo3temp/DynCss ]")
        info "Clearning cached (S)CSS file at #{shared_path}/typo3temp/DynCss/* …"
        execute "rm -rf #{shared_path}/typo3temp/DynCss/*"
      else
        info "No (S)CSS file to remove at #{shared_path}/typo3temp/DynCss/*."
      end

      if test("[ -d #{shared_path}/typo3temp/Cache ]")
        info "Clearning TYPO3 cache at #{shared_path}/typo3temp/Cache/* …"
        execute "rm -rf #{shared_path}/typo3temp/Cache/*"
      else
        info "No TYPO3 cache folder at #{shared_path}/typo3temp/Cache/* (yet?), not clearing it."
      end
    end
  end

  before :starting, :mysqlbackup

  desc "Backup MySQL Database"
  task :mysqlbackup do
    on roles(:web) do
      execute "mysqldump --socket=/tmp/mysql5.sock -u#{fetch(:db_username)} -p#{fetch(:db_password)} #{fetch(:db_database)} > #{shared_path}/backups/#{release_timestamp}.sql"
      execute "gzip #{shared_path}/backups/#{release_timestamp}.sql"
    end
  end

end

0 个答案:

没有答案