forked from RedHatQE/firewatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjira_config_gen.py
53 lines (49 loc) · 1.14 KB
/
jira_config_gen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import click
from click import Context
from src.jira_config_gen.jira_config_gen import JiraConfig
@click.option(
"--server-url",
help='Jira server URL, i.e "https://issues.stage.redhat.com"',
required=True,
type=click.STRING,
)
@click.option(
"--token-path",
help="Path to the Jira API token",
required=True,
type=click.Path(exists=True),
)
@click.option(
"--output-file",
help="Where the rendered config will be stored",
default="/tmp/jira.config",
type=click.Path(),
)
@click.option(
"--template-path",
help="Directory holding templates",
default="/firewatch/src/templates/jira.config.j2",
type=click.Path(exists=True),
)
@click.option(
"--pdb",
help="Drop to `ipdb` shell on exception",
is_flag=True,
)
@click.command("jira-config-gen")
@click.pass_context
def jira_config_gen(
ctx: Context,
server_url: str,
token_path: str,
output_file: str,
template_path: str,
pdb: bool,
) -> None:
ctx.obj["PDB"] = pdb
JiraConfig(
server_url=server_url,
token_path=token_path,
output_file=output_file,
template_path=template_path,
)