Execute scripts with Hoop connections
Allows executing one-off scripts using the underlying Operating System tools.
Connection Command
python3
note
This mode requires the agent running on top of a Linux that has the python3 runtime.
How to Use
Now it's possible to execute python scripts straight from Hoop
hoop exec python3-prod -i 'import os; print(os.environ)'
# asumming the runtime has the boto3 dependency installed
hoop exec python3-prod <<EOF
s3 = boto3.client('s3')
response = s3.list_buckets()
print('Existing buckets:')
for bucket in response['Buckets']:
print(f' {bucket["Name"]}')
EOF
It's possible to start an interactive session with pyhon
hoop connect python3-prod
Calling scripts are easy too
hoop exec python3-prod -- /tmp/myscript.py