Skip to content

Commit

Permalink
Add CICD option to script
Browse files Browse the repository at this point in the history
  • Loading branch information
isamauny committed Feb 9, 2024
1 parent 5c26b81 commit 04f2112
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .42c/scripts/pixi-login.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ def main():
default=False,
action="store_true",
help="debug level")
parser.add_argument ('-c','--cicd',
required=True,
help="One of GITHUB/AZURE")
parsed_cli = parser.parse_args()

quiet = parsed_cli.quiet
debug = parsed_cli.debug
user = parsed_cli.user_name
password = parsed_cli.user_pass
cicd_platform = parsed_cli.cicd

user_token = obtain_token(user, password, target_url=parsed_cli.target, quiet=quiet, debug=debug)
# Uncomment this for integration with Azure DevOps
Expand All @@ -82,8 +86,13 @@ def main():
sys.exit(1)

else:
subprocess.Popen(["echo", "##vso[task.setvariable variable=PIXI_TOKEN;isoutput=true]{0}".format(user_token)])

match cicd_platform:
case "GITHUB":
print(user_token)
case "AZURE":
subprocess.Popen(["echo", "##vso[task.setvariable variable=PIXI_TOKEN;isoutput=true]{0}".format(user_token)])
case _:
print ("Unsupported CICD option")

# -------------- Main Section ----------------------
if __name__ == '__main__':
Expand Down

0 comments on commit 04f2112

Please sign in to comment.