Как создать задачу capistrano 'hook' с атрибутами - PullRequest
0 голосов
/ 16 июня 2020

Я пытаюсь создать задачу capistrano 3, которая обрабатывает атрибут, и эта задача вызывается из ловушки. Например, чтобы «пометить» в процессе развертывания, когда обрабатывается каждый перехватчик, вы можете сделать следующее ...

$ cap production deploy:notify["hello world"]
00:00 rbenv:validate
************ Hook hello world Processed ***************
$

Однако, когда я пытаюсь вызвать задачу из ловушки, я получаю следующее ...

$  cap --hosts=rpi-tick2.rustyshamrock.local  production deploy
00:00 rbenv:validate
      rbenv: rbenv_ruby is not set; ruby version will be defined by the remote hosts via rbenv
(Backtrace restricted to imported tasks)
cap aborted!
Don't know how to build task '' (See the list of available tasks with `cap --tasks`)

Tasks: TOP => deploy:starting
(See full trace by running task with --trace)
The deploy has failed with an error: Don't know how to build task '' (See the list of available tasks with `cap --tasks`)


** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:


 DEBUG [a65d9ebd] Running [ -f /home/deploy/gps_monitor/repo/HEAD ] as deploy@rpi-tick2.rustyshamrock.local

 DEBUG [a65d9ebd] Command: [ -f /home/deploy/gps_monitor/repo/HEAD ]

 DEBUG [a65d9ebd] Finished in 0.069 seconds with exit status 0 (successful).

  INFO The repository mirror is at /home/deploy/gps_monitor/repo

 DEBUG [286f3477] Running if test ! -d /home/deploy/gps_monitor/repo; then echo "Directory does not exist '/home/deploy/gps_monitor/repo'" 1>&2; false; fi as deploy@rpi-tick2.rustyshamrock.local

 DEBUG [286f3477] Command: if test ! -d /home/deploy/gps_monitor/repo; then echo "Directory does not exist '/home/deploy/gps_monitor/repo'" 1>&2; false; fi

 DEBUG [286f3477] Finished in 0.059 seconds with exit status 0 (successful).

  INFO [06e821c7] Running /usr/bin/env git remote set-url origin git@github.com:sjf-control/TickProject.git as deploy@rpi-tick2.rustyshamrock.local

 DEBUG [06e821c7] Command: cd /home/deploy/gps_monitor/repo && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="" GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-gps_monitor-production-sjf.sh" ; /usr/bin/env git remote set-url origin git@github.com:sjf-control/TickProject.git )

  INFO [06e821c7] Finished in 0.075 seconds with exit status 0 (successful).

  INFO [78d0be52] Running /usr/bin/env git remote update --prune as deploy@rpi-tick2.rustyshamrock.local

 DEBUG [78d0be52] Command: cd /home/deploy/gps_monitor/repo && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="" GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-gps_monitor-production-sjf.sh" ; /usr/bin/env git remote update --prune )

 DEBUG [78d0be52]   Fetching origin

  INFO ---------------------------------------------------------------------------

  INFO START 2020-06-16 08:33:56 -0500 cap production deploy

  INFO ---------------------------------------------------------------------------

  INFO rbenv: rbenv_ruby is not set; ruby version will be defined by the remote hosts via rbenv

 DEBUG [05808924] Running /usr/bin/env which passenger as deploy@rpi-tick2.rustyshamrock.local

 DEBUG [05808924] Command: /usr/bin/env which passenger

 DEBUG [05808924] Finished in 0.452 seconds with exit status 1 (failed).

Можно ли создать ловушку с атрибутом? Как? Спасибо за любую помощь!

...