I need to set an environment variable from a Groovy script, the value of the env var should be produced with the AWS CLI, my command
def proc ='aws codeartifact get-authorization-token --region=eu-central-1 --domain companyname --domain-owner accountnumber --query authorizationToken --output text'.execute()
env.CODEARTIFACT_AUTH_TOKEN = proc.in.text
But I get an error message
10:59:47 Caused: java.io.IOException: Cannot run program "aws": error=2, No such file or directory
I am new to Groovy and looking around for solutions, any tips in the meanwhile?