Created
April 30, 2020 05:37
-
-
Save petitviolet/28bcc9a5643c6f244346b4a8b07af8a7 to your computer and use it in GitHub Desktop.
digdag's `http_call>` operator sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+run_workflow: | |
http_call>: http://$(ip):8000/http_call_dig | |
retry: false | |
_retry: 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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