使用Capistrano 3进行部署时输出任务名称

时间:2022-04-02 02:05:41

Is there a way to force Capistrano 3 to print the names of the tasks being performed when deploying an app.

有没有办法强制Capistrano 3打印部署应用程序时正在执行的任务的名称。

E.g. I would like to get something like:

例如。我想得到类似的东西:

deploy:starting
  # some commands
  # some commands
some_custom_task
  # some commands
  # some commands
deploy:started
  # some commands
  # some commands
some_another_custom_task
  # some commands
  # some commands
deploy:updating 
  # some commands
  # some commands

Thanks

1 个解决方案

#1


Old question, but what you are looking for is --trace or -t.

老问题,但你要找的是--trace或-t。

From the help doc:

从帮助文档中:

-t, --trace=[OUT]                Turn on invoke/execute tracing, enable full backtrace. OUT can be stderr (default) or stdout.

It looks something like this (excerpt):

它看起来像这样(摘录):

* Invoke stage (first_time)
** Execute stage
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rbenv:validate (first_time)
** Execute rbenv:validate
DEBUG [f8847463] Running /usr/bin/env [ -d ~/.rbenv/versions/2.2.3 ] as user@example.com
DEBUG [f8847463] Command: [ -d ~/.rbenv/versions/2.2.3 ]
DEBUG [f8847463] Finished in 3.706 seconds with exit status 0 (successful).
** Invoke rbenv:map_bins (first_time)
** Execute rbenv:map_bins
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_rails_env
** 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

Hopefully this helps you or someone else.

希望这可以帮助您或其他人。

#1


Old question, but what you are looking for is --trace or -t.

老问题,但你要找的是--trace或-t。

From the help doc:

从帮助文档中:

-t, --trace=[OUT]                Turn on invoke/execute tracing, enable full backtrace. OUT can be stderr (default) or stdout.

It looks something like this (excerpt):

它看起来像这样(摘录):

* Invoke stage (first_time)
** Execute stage
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rbenv:validate (first_time)
** Execute rbenv:validate
DEBUG [f8847463] Running /usr/bin/env [ -d ~/.rbenv/versions/2.2.3 ] as user@example.com
DEBUG [f8847463] Command: [ -d ~/.rbenv/versions/2.2.3 ]
DEBUG [f8847463] Finished in 3.706 seconds with exit status 0 (successful).
** Invoke rbenv:map_bins (first_time)
** Execute rbenv:map_bins
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_rails_env
** 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

Hopefully this helps you or someone else.

希望这可以帮助您或其他人。