-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,10 @@ | |
"""Script to spawn a reactive runner.""" | ||
import argparse | ||
import logging | ||
import os | ||
|
||
from reactive.runner import reactive_runner | ||
from reactive.runner_manager import REACTIVE_RUNNER_LOG_PATH | ||
from reactive.runner_manager import MQ_URI_ENV_VAR, REACTIVE_RUNNER_LOG_PATH | ||
|
||
|
||
def setup_root_logging() -> None: | ||
|
@@ -21,14 +22,21 @@ def setup_root_logging() -> None: | |
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
|
||
parser.add_argument( | ||
"mq_uri", | ||
help="URI of the message queue database. This should include authentication information." | ||
" E.g. : mongodb://user:[email protected]/github-runner-webhook-router" | ||
"?replicaSet=mongodb&authSource=admin", | ||
"queue_name", help="Name of the message queue to consume from. E.g. : large" | ||
) | ||
|
||
mq_uri = os.environ.get(MQ_URI_ENV_VAR) | ||
argument_opts: dict = {"default": mq_uri} if mq_uri else {"required": True} | ||
parser.add_argument( | ||
"queue_name", help="Name of the message queue to consume from. E.g. : large" | ||
"--mq-uri", | ||
help="URI of the message queue database. This should include authentication information." | ||
f"The argument is required but can also be set via the {MQ_URI_ENV_VAR} " | ||
"environment variable." | ||
" Example URI : mongodb://user:[email protected]/github-runner-webhook-router" | ||
"?replicaSet=mongodb&authSource=admin", | ||
**argument_opts, | ||
) | ||
arguments = parser.parse_args() | ||
|
||
|
This file contains 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
This file contains 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