Skip to content

Instantly share code, notes, and snippets.

@astromechza
Created September 12, 2024 14:29
Show Gist options
  • Save astromechza/4405fb7a71d75c2422b66cea372021e9 to your computer and use it in GitHub Desktop.
Save astromechza/4405fb7a71d75c2422b66cea372021e9 to your computer and use it in GitHub Desktop.
An example environment provisioner that reads a .env file in the working directory.
- uri: cmd://python3#dotenv
type: environment
args:
- -c
- |
import json
with open('.env') as f:
content = f.read().strip()
env_map = dict([x.split("=",1) for x in content.strip().splitlines()])
print(json.dumps({"resource_outputs": env_map}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment