dimanche 12 février 2017

Capistrano 3 Task : how to pass a parameter

Vote count: 0

I have a pm2 task to get the status, which require now a -s parameter to be passed over, how can I pass it in

ps = JSON.parse(capture :pm2, :jlist, fetch(:app_command))

here is my complete task :

require 'json'
namespace :pm2 do
  def app_status
    within current_path do
      ps = JSON.parse(capture :pm2, :jlist, fetch(:app_command))
      if ps.empty?
        return nil
      else
        # status: online, errored, stopped
        return ps[0]["pm2_env"]["status"]
      end
    end
  end
end

asked 44 secs ago

Let's block ads! (Why?)



Capistrano 3 Task : how to pass a parameter

Aucun commentaire:

Enregistrer un commentaire