More than 5 years have passed since last update.

digdagコマンドが fish 互換無かったときにしたこと

Last updated at Posted at 2017-10-18

仕事で digdag を使う機会があった。
その当時はデフォルトで fish サポートしてくれておらず悲しい気持ちになった。

digdag インストール

※環境変数を設定する3つめのコマンドは fish 仕様に修正してある

$ curl -o ~/bin/digdag --create-dirs -L "https://dl.digdag.io/digdag-latest"
$ chmod +x ~/bin/digdag
$ echo 'set -gx PATH $HOME/bin $PATH' >> ~/.config/fish/config.fish


$ digdag -v
Failed to execute process '/Users/xyxyxy/bin/digdag'. Reason:
exec: Exec format error
The file '/Users/xyxyxy/bin/digdag' is marked as an executable but could not be run by the operating system.


fish を退出して実行

$ digdag -v
2017-10-18 18:58:34 +0900: Digdag v0.9.20
Usage: digdag <command> [options...]
  Local-mode commands:
    init <dir>                         create a new workflow project
    r[un] <workflow.dig>               run a workflow
    c[heck]                            show workflow definitions
    sched[uler]                        run a scheduler server
    selfupdate                         update cli to the latest version

  Server-mode commands:
    server                             start server

  Client-mode commands:
    push <project-name>                create and upload a new revision
    download <project-name>            pull an uploaded revision
    start <project-name> <name>        start a new session attempt of a workflow
    retry <attempt-id>                 retry a session
    kill <attempt-id>                  kill a running session attempt
    backfill <project-name> <name>     start sessions of a schedule for past times
    reschedule                         skip sessions of a schedule to a future time
    log <attempt-id>                   show logs of a session attempt
    workflows [project-name] [name]    show registered workflow definitions
    schedules                          show registered schedules
    disable <schedule-id>              disable a workflow schedule
    disable <project-name>             disable all workflow schedules in a project
    disable <project-name> <name>      disable a workflow schedule
    enable <schedule-id>               enable a workflow schedule
    enable <project-name>              enable all workflow schedules in a project
    enable <project-name> <name>       enable a workflow schedule
    sessions                           show sessions for all workflows
    sessions <project-name>            show sessions for all workflows in a project
    sessions <project-name> <name>     show sessions for a workflow
    session  <session-id>              show a single session
    attempts                           show attempts for all sessions
    attempts <session-id>              show attempts for a session
    attempt  <attempt-id>              show a single attempt
    tasks <attempt-id>                 show tasks of a session attempt
    delete <project-name>              delete a project
    secrets --project <project-name>   manage secrets
    version                            show client and server version

    -L, --log PATH                   output log messages to a file (default: -)
    -l, --log-level LEVEL            log level (error, warn, info, debug or trace)
    -X KEY=VALUE                     add a performance system config
    -c, --config PATH.properties     Configuration file (default: /Users/xyxyxy/.config/digdag/config)

Use `<command> --help` to see detailed usage of a command.


bash からコマンドを叩ければ問題ないらしい

$ echo "alias digdag '/bin/bash ~/bin/digdag'" >> ~/.config/fish/config.fish



Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up