2

部署symfony:assets:install任务崩溃

set :application, "example"
set :domain,      "#{application}.com"
set :deploy_to,   "/fake/path"
set :app_path,    "app"
set :user, "opr"
set :use_composer, true
set :composer_options,  "--no-dev --verbose --prefer-dist --optimize-autoloader"
set :update_vendors, true


set :repository,  "ssh://hg@bitbucket.org/fake/path"
set :branch, "default"
set :scm,         :mercurial
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`

set :model_manager, "doctrine"
# Or: `propel`

role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain, :primary => true        # This may be the same as your `Web` server
role :db,         domain, :primary => true       # This is where Symfony2 migrations will run

set  :keep_releases,  5
set :use_sudo, false

set :shared_files,      ["app/config/parameters.yml"]
set :shared_children,     [app_path + "/logs", web_path + "/uploads"]


after "deploy:update", "upload_parameters"

# after "symfony:assets:install", "symfony:assetic:dump"

after "deploy:create_symlink" do
    run "chmod -R a+rw #{deploy_to}/current/app/cache"
    run "chmod -R a+rw #{deploy_to}/current/app/logs"
end

task :upload_parameters do
  origin_file = "app/config/parameters.yml"
  destination_file = shared_path + "/app/config/parameters.yml"

  try_sudo "mkdir -p #{File.dirname(destination_file)}"
  top.upload(origin_file, destination_file)
end

after "deploy:restart", "deploy:cleanup" 

# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL
# default_run_options[:pty] = true
ssh_options[:forward_agent] = true

这是完整的输出:

  * 2014-01-17 14:23:10 executing `deploy'
  * 2014-01-17 14:23:10 executing `deploy:update'
 ** transaction: start
  * 2014-01-17 14:23:10 executing `deploy:update_code'
    triggering before callbacks for `deploy:update_code'
--> Updating code base with checkout strategy
    executing locally: "hg log -r default --template \"{node|short}\""
    command finished in 100ms
  * executing "hg clone --noupdate ssh://hg@bitbucket.org/project /fake/path/releases/20140117122310 && hg update --repository /fake/path/releases/20140117122310 --clean 588549f82b3b && (echo 588549f82b3b > /fake/path/releases/20140117122310/REVISION)"
    servers: ["example.com"]
Password: 
    [example.com] executing command
 ** [example.com :: out] requesting all changes
 ** adding changesets
 ** adding manifests
 ** adding file changes
 ** added 1090 changesets with 13637 changes to 9254 files
 ** [example.com :: out] 477 files updated, 0 files merged, 0 files removed, 0 files unresolved
    command finished in 60514ms
  * 2014-01-17 14:24:14 executing `deploy:finalize_update'
  * executing "chmod -R g+w /fake/path/releases/20140117122310"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 207ms
--> Creating cache directory
  * executing "sh -c 'if [ -d /fake/path/releases/20140117122310/app/cache ] ; then rm -rf /fake/path/releases/20140117122310/app/cache; fi'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 157ms
  * executing "sh -c 'mkdir -p /fake/path/releases/20140117122310/app/cache && chmod -R 0777 /fake/path/releases/20140117122310/app/cache'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 158ms
  * executing "chmod -R g+w /fake/path/releases/20140117122310/app/cache"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 154ms
  * 2014-01-17 14:24:15 executing `deploy:share_childs'
--> Creating symlinks for shared directories
  * executing "mkdir -p /fake/path/shared/app/logs"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 156ms
  * executing "sh -c 'if [ -d /fake/path/releases/20140117122310/app/logs ] ; then rm -rf /fake/path/releases/20140117122310/app/logs; fi'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 153ms
  * executing "ln -nfs /fake/path/shared/app/logs /fake/path/releases/20140117122310/app/logs"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 151ms
  * executing "mkdir -p /fake/path/shared/web/uploads"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 152ms
  * executing "sh -c 'if [ -d /fake/path/releases/20140117122310/web/uploads ] ; then rm -rf /fake/path/releases/20140117122310/web/uploads; fi'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 153ms
  * executing "ln -nfs /fake/path/shared/web/uploads /fake/path/releases/20140117122310/web/uploads"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 151ms
--> Creating symlinks for shared files
  * executing "mkdir -p /fake/path/shared/app/config"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 153ms
  * executing "touch /fake/path/shared/app/config/parameters.yml"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 150ms
  * executing "ln -nfs /fake/path/shared/app/config/parameters.yml /fake/path/releases/20140117122310/app/config/parameters.yml"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 153ms
--> Normalizing asset timestamps
  * executing "find /fake/path/releases/20140117122310/web/css /fake/path/releases/20140117122310/web/images /fake/path/releases/20140117122310/web/js -exec touch -t 201401171224.16 {} ';' &> /dev/null || true"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 155ms
    triggering after callbacks for `deploy:finalize_update'
  * 2014-01-17 14:24:16 executing `symfony:composer:update'
    triggering before callbacks for `symfony:composer:update'
  * 2014-01-17 14:24:16 executing `symfony:composer:get'
  * executing "ls -x /fake/path/releases"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 152ms
  * executing "if [ -e /fake/path/releases/20140113143043/composer.phar ]; then echo 'true'; fi"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 153ms
--> Copying Composer from previous release
  * executing "sh -c 'cp /fake/path/releases/20140113143043/composer.phar /fake/path/releases/20140117122310/'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 161ms
  * executing "if [ -e /fake/path/releases/20140117122310/composer.phar ]; then echo 'true'; fi"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 154ms
--> Updating Composer
  * executing "sh -c 'cd /fake/path/releases/20140117122310 && php composer.phar self-update'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 182ms
--> Updating Composer dependencies
  * executing "sh -c 'cd /fake/path/releases/20140117122310 && php composer.phar update --no-dev --verbose --prefer-dist --optimize-autoloader'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 185ms
  * 2014-01-17 14:24:17 executing `symfony:bootstrap:build'
--> Building bootstrap file
  * executing "if [ -e /fake/path/releases/20140117122310/bin/build_bootstrap ]; then echo 'true'; fi"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 154ms
  * executing "sh -c 'cd /fake/path/releases/20140117122310 && test -f vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php && php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php app || echo 'vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php not found, skipped''"
    servers: ["example.com"]
    [example.com] executing command
 ** [out :: example.com] vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
    command finished in 157ms
  * 2014-01-17 14:24:18 executing `symfony:composer:dump_autoload'
--> Dumping an optimized autoloader
  * executing "sh -c 'cd /fake/path/releases/20140117122310 && php composer.phar dump-autoload --optimize'"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 186ms
  * 2014-01-17 14:24:18 executing `symfony:assets:install'
--> Installing bundle's assets
  * executing "sh -c 'cd /fake/path/releases/20140117122310 && php app/console assets:install web --env=prod'"
    servers: ["example.com"]
    [example.com] executing command
*** [err :: example.com] PHP Warning:  require(/fake/path/releases/20140117122310/app/../vendor/autoload.php): failed to open stream: No such file or directory in /fake/path/releases/20140117122310/app/autoload.php on line 5
*** [err :: example.com] PHP Stack trace:
*** [err :: example.com] PHP   1. {main}() /fake/path/releases/20140117122310/app/console:0
*** [err :: example.com] PHP   2. require_once() /fake/path/releases/20140117122310/app/console:10
*** [err :: example.com] PHP   3. require_once() /fake/path/releases/20140117122310/app/bootstrap.php.cache:3
*** [err :: example.com] PHP Fatal error:  require(): Failed opening required '/fake/path/releases/20140117122310/app/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /fake/path/releases/20140117122310/app/autoload.php on line 5
*** [err :: example.com] PHP Stack trace:
*** [err :: example.com] PHP   1. {main}() /fake/path/releases/20140117122310/app/console:0
*** [err :: example.com] PHP   2. require_once() /fake/path/releases/20140117122310/app/console:10
*** [err :: example.com] PHP   3. require_once() /fake/path/releases/20140117122310/app/bootstrap.php.cache:3
    command finished in 188ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /fake/path/releases/20140117122310; true"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 307ms
failed: "sh -c 'sh -c '\\''cd /fake/path/releases/20140117122310 && php app/console assets:install web --env=prod'\\'''" on example.com
4

0 回答 0