34 lines
792 B
Python
34 lines
792 B
Python
import os
|
|
import sys
|
|
import time
|
|
|
|
from allspice import AllSpice
|
|
|
|
CERT_ENV_VARS = [
|
|
"NODE_EXTRA_CA_CERTS",
|
|
"REQUESTS_CA_BUNDLE",
|
|
"SSL_CERT_FILE",
|
|
]
|
|
|
|
|
|
def main():
|
|
for var in CERT_ENV_VARS:
|
|
print(f"{var}={repr(os.environ.get(var))}")
|
|
|
|
allspice_hub_url = os.environ.get("GITHUB_SERVER_URL")
|
|
auth_token = os.environ.get("ALLSPICE_AUTH_TOKEN")
|
|
|
|
try:
|
|
if not allspice_hub_url or not auth_token:
|
|
print("ALLSPICE_AUTH_TOKEN and GITHUB_SERVER_URL must be set")
|
|
else:
|
|
client = AllSpice(allspice_hub_url=allspice_hub_url, token_text=auth_token)
|
|
print(client.get_user().username)
|
|
finally:
|
|
# sleep to allow inspection of environment
|
|
time.sleep(600)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|