jumpstarter-dev / jumpstarter

http://docs.jumpstarter.dev/
3 stars 3 forks source link

Generic driver to map command calls to shell or shell in container calls. #155

Open mangelajo opened 3 weeks ago

mangelajo commented 3 weeks ago

@NickCao, please explain in the description :)

NickCao commented 3 weeks ago
children:
  power:
    type: jumpstarter.drivers.command.driver.Command
    config:
      on: ["./power_on.sh"]
      off: ["./power_off.sh"]
mangelajo commented 3 weeks ago

What do you think about making it shell-specific instead, so we could run shell commands instead of just binaries?

Command makes it look very generic, may be Shell is more specific? WDYT?

Also some additional ideas,so we can pass arguments, and another layer so, later in time we have room for extensibility (i.e. providing other config arguments like shell interpreter or anything like that)

children:
  power:
    type: jumpstarter.drivers.shell.driver.Shell
    config:
       methods:
          on: "/usr/bin/power on"
          off: "/usr/bin/power off"
          free: "free -h"
          multiline_params: >
             echo "hi,"
             echo "I am a multi-line script"
             echo "I accept parameters ${1} ${2}"