Skip to content

Commit c1caf7b

Browse files
author
aaronstrateos
committed
added staging flag for not yet released web features
1 parent d430afc commit c1caf7b

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

transcriptic/cli.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,13 +615,19 @@ def select_org_cmd(ctx, organization=None):
615615
type=click.Path(exists=True, file_okay=True, dir_okay=False),
616616
help="Path to RSA key used for signing requests",
617617
)
618+
@click.option(
619+
"--web-staging",
620+
is_flag=True,
621+
required=False,
622+
help="login to staging environment for testing changes in master of web that are not yet released to production",
623+
)
618624
@click.pass_context
619-
def login_cmd(ctx, api_root=None, analytics=True, rsa_key=None):
625+
def login_cmd(ctx, api_root=None, analytics=True, rsa_key=None, web_staging=False):
620626
"""Authenticate to your Transcriptic account."""
627+
ctx.obj.api = Connection()
621628
api = ctx.obj.api
622629
config = ctx.parent.params["config"]
623-
commands.login(api, config, api_root, analytics, rsa_key)
624-
630+
commands.login(api, config, api_root, analytics, rsa_key, web_staging)
625631

626632
@cli.command("format", cls=FeatureCommand, feature="can_upload_packages")
627633
@click.argument("manifest", default="manifest.json")

transcriptic/commands.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,18 +1048,16 @@ def select_org(api, config, organization=None):
10481048
click.echo(f"Logged in with organization: {organization}")
10491049

10501050

1051-
def login(api, config, api_root=None, analytics=True, rsa_key=None):
1051+
def login(api, config, api_root=None, analytics=True, rsa_key=None, web_staging=False):
10521052
"""Authenticate to your Transcriptic account."""
1053-
if api_root is None:
1054-
# Always default to the pre-defined api-root if possible, else use
1055-
# the secure.transcriptic.com domain
1056-
try:
1057-
api_root = api.api_root
1058-
except ValueError:
1059-
api_root = "https://secure.transcriptic.com"
1060-
1053+
# If user does not specify staging web api argument, default to the "https://secure.strateos.com" domain
1054+
if web_staging:
1055+
api_root = "https://webapp.staging.strateos.com/"
1056+
else:
1057+
api_root = "https://secure.strateos.com/"
10611058
rsa_auth = None
10621059
rsa_key_path = None
1060+
10631061
if rsa_key is not None:
10641062
try:
10651063
rsa_key_path = abspath(expanduser(rsa_key))

0 commit comments

Comments
 (0)