-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(run scripts): create run scripts
Create run scripts for dispatcher server & repo observer
- Loading branch information
1 parent
1604b62
commit d249fea
Showing
6 changed files
with
83 additions
and
65 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import argparse | ||
from ci.dispatcher.dispatcher import dispatcher | ||
|
||
|
||
def run_dispatcher(): | ||
""" | ||
Entry point to dispatch server | ||
""" | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--host", | ||
help="Dispatchers host, defaults to localhost", | ||
default="localhost", | ||
action="store", | ||
) | ||
parser.add_argument( | ||
"--port", | ||
help="Dispatchers port, defaults to 8000", | ||
default=8000, | ||
action="store", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
dispatcher(args.host, int(args.port)) | ||
|
||
|
||
if __name__ == "__main__": | ||
run_dispatcher() |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import argparse | ||
|
||
from ci.repo_observer.observer import observer | ||
|
||
|
||
def run_observer(): | ||
""" | ||
Run Observer | ||
""" | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--dispatcher-server", | ||
help="dispatcher host:port , by default it uses localhost:8000", | ||
default="localhost:8000", | ||
action="store", | ||
) | ||
parser.add_argument( | ||
"--repo", metavar="REPO", type=str, help="path to the repository to observe" | ||
) | ||
parser.add_argument( | ||
"--poll", help="how long to keep polling repository", default=5, type=int | ||
) | ||
parser.add_argument( | ||
"--branch", help="which branch to run tests against", default="master", type=str | ||
) | ||
|
||
args = parser.parse_args() | ||
dispatcher_host, dispatcher_port = args.dispatcher_server.split(":") | ||
|
||
observer(dispatcher_host, dispatcher_port, args.repo, args.poll, args.branch) | ||
|
||
|
||
if __name__ == "__main__": | ||
run_observer() |