mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
15 lines
323 B
Python
15 lines
323 B
Python
import os
|
|
|
|
def get_env(name):
|
|
ret = os.getenv(name, None)
|
|
if not ret:
|
|
print("Failed to obtain env var {}. Skipping GCP setup.".format(name))
|
|
exit(0)
|
|
return ret
|
|
|
|
path = get_env("GOOGLE_APPLICATION_CREDENTIALS")
|
|
contents = get_env("GCP_CREDS")
|
|
|
|
with open(path, 'w+') as fd:
|
|
fd.write(contents)
|