Skip to content

Instantly share code, notes, and snippets.

@petitviolet
Created April 30, 2020 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petitviolet/28bcc9a5643c6f244346b4a8b07af8a7 to your computer and use it in GitHub Desktop.
Save petitviolet/28bcc9a5643c6f244346b4a8b07af8a7 to your computer and use it in GitHub Desktop.
digdag's `http_call>` operator sample
+run_workflow:
http_call>: http://$(ip):8000/http_call_dig
retry: false
_retry: 2
require 'webrick'
require 'cgi'
s = WEBrick::HTTPServer.new(
:Port => 8000,
:HTTPVersion => WEBrick::HTTPVersion.new('1.1'),
)
s.mount_proc('/http_call_dig') do |req, res|
res.status = 200
res['Content-Type'] = 'application/x-yaml'
res.body = <<~YAML
+task_1:
echo>: "hello ${session_time}"
+task_2:
fail>: "fail!"
YAML
end
Signal.trap('INT'){s.shutdown}
s.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment