Skip to content
This repository has been archived by the owner on Jan 5, 2020. It is now read-only.

Latest commit

 

History

History
18 lines (14 loc) · 584 Bytes

running-shell-commands.md

File metadata and controls

18 lines (14 loc) · 584 Bytes

Running Shell Commands

Although you can use any Ruby method to execute shell and system commands from within your jobs, Jobly comes bundled with TTY::Command which is made available to your jobs by using the #shell method.

{% code-tabs %} {% code-tabs-item title="jobs/shell.rb" %}

class Shell < Jobly::Job
  def execute
    shell.run "docker pull ubuntu"
  end
end

{% endcode-tabs-item %} {% endcode-tabs %}

Using this method automatically sends the STDOUT and STDERR of the command to the configured logging device.