【问题标题】:Capistrano deploy namespaceCapistrano 部署命名空间
【发布时间】:2011-12-13 10:12:38
【问题描述】:

所有 capistrano 文档似乎都建议有一个默认命名空间“部署”,其中包含一些标准任务,如 setup、update_code、restart 等。但是当我执行 cap -T 时,它只显示我定义的任务而不是部署任务。我是否需要做任何其他事情来启用部署任务。我正在使用 capistrano 版本 2.9.0

【问题讨论】:

    标签: ruby capistrano


    【解决方案1】:

    mbp:cms Bladeyu [master] $ cap -T

    cap bundle:install           # Install the current Bundler environment.
    cap deploy                   # Deploys your project.
    cap deploy:assets:clean      # Run the asset clean rake task.
    cap deploy:assets:precompile # Run the asset precompilation rake task.
    cap deploy:check             # Test deployment dependencies.
    cap deploy:cleanup           # Clean up old releases.
    cap deploy:cold              # Deploys and starts a `cold' application.
    cap deploy:migrate           # Run the migrate rake task.
    cap deploy:migrations        # Deploy and run pending migrations.
    cap deploy:pending           # Displays the commits since your last deploy.
    cap deploy:pending:diff      # Displays the `diff' since your last deploy.
    cap deploy:rollback          # Rolls back to a previous version and restarts.
    cap deploy:rollback:code     # Rolls back to the previously deployed version.
    cap deploy:setup             # Prepares one or more servers for deployment.
    cap deploy:symlink           # Updates the symlink to the most recently deplo...
    cap deploy:update            # Copies your project and updates the symlink.
    cap deploy:update_code       # Copies your project to the remote servers.
    cap deploy:upload            # Copy files to the currently deployed version.
    cap deploy:web:disable       # Present a maintenance page to visitors.
    cap deploy:web:enable        # Makes the application web-accessible again.
    cap invoke                   # Invoke a single command on the remote servers.
    cap shell                    # Begin an interactive Capistrano session.
    cap whenever:clear_crontab   # Clear application's crontab entries using When...
    cap whenever:update_crontab  # Update application's crontab entries using Whe...
    
    
    Some tasks were not listed, either because they have no description,
    or because they are only used internally by other tasks. To see all
    tasks, type `cap -vT'.
    
    Extended help may be available for these tasks.
    Type `cap -e taskname' to view it.
    

    mbp:cms Bladeyu [master] $ gem list capistrano

    *** LOCAL GEMS ***
    
    capistrano (2.9.0)
    

    mbp:cms Bladeyu [master] $ cap -vT

    cap assets:cleanup           # 
    cap assets:precompile        # 
    cap assets:redigest          # 
    cap bundle:install           # Install the current Bundler environment.
    cap custom_symlink           # 
    cap deploy                   # Deploys your project.
    cap deploy:assets:clean      # Run the asset clean rake task.
    cap deploy:assets:precompile # Run the asset precompilation rake task.
    cap deploy:assets:symlink    # [internal] This task will set up a symlink to ...
    cap deploy:check             # Test deployment dependencies.
    cap deploy:cleanup           # Clean up old releases.
    cap deploy:cold              # Deploys and starts a `cold' application.
    cap deploy:finalize_update   # [internal] Touches up the released code.
    cap deploy:migrate           # Run the migrate rake task.
    cap deploy:migrations        # Deploy and run pending migrations.
    cap deploy:pending           # Displays the commits since your last deploy.
    cap deploy:pending:diff      # Displays the `diff' since your last deploy.
    cap deploy:restart           # 
    cap deploy:rollback          # Rolls back to a previous version and restarts.
    cap deploy:rollback:cleanup  # [internal] Removes the most recently deployed ...
    cap deploy:rollback:code     # Rolls back to the previously deployed version.
    cap deploy:rollback:revision # [internal] Points the current symlink at the p...
    cap deploy:setup             # Prepares one or more servers for deployment.
    cap deploy:start             # 
    cap deploy:stop              # 
    cap deploy:symlink           # Updates the symlink to the most recently deplo...
    cap deploy:update            # Copies your project and updates the symlink.
    cap deploy:update_code       # Copies your project to the remote servers.
    cap deploy:upload            # Copy files to the currently deployed version.
    cap deploy:web:disable       # Present a maintenance page to visitors.
    cap deploy:web:enable        # Makes the application web-accessible again.
    cap invoke                   # Invoke a single command on the remote servers.
    cap precompile_trace         # 
    cap setup_file_tree          # 
    cap shell                    # Begin an interactive Capistrano session.
    cap whenever:clear_crontab   # Clear application's crontab entries using When...
    cap whenever:update_crontab  # Update application's crontab entries using Whe...
    
    Extended help may be available for these tasks.
    Type `cap -e taskname' to view it.
    

    【讨论】:

      【解决方案2】:

      您在项目根目录中有一个名为Capfile 的文件吗? 我的跟随

      load 'deploy' if respond_to?(:namespace) # cap2 differentiator
      Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
      load 'config/deploy'
      

      【讨论】:

      • 我没有使用 capify 生成 Capfile,因此它没有您提到的行。添加这些行后,它就可以工作了。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-11
      • 1970-01-01
      • 1970-01-01
      • 2021-08-11
      • 2021-11-30
      • 2019-12-13
      • 1970-01-01
      相关资源
      最近更新 更多