<commit_before>printf "\nbuild d app\n"
cd d/alexa-openwebif
dub build

printf "\nbuild zip\n"
zip -j arch.zip ../../node/index.js libssl.so.10 libevent-2.0.so.5 libcrypto.so.10 libevent_pthreads-2.0.so.5 alexa-openwebif

printf "\nupload zip\n"
aws lambda update-function-code --function-name <name> --zip-file fileb://./arch.zip

printf "\nset environment\n"
aws lambda update-function-configuration --function-name <name> --environment 'Variables={OPENWEBIF_URL="http://your.openwebif.endpoint"}'

printf "\ntest invoke\n"
cd ../../
aws lambda invoke --invocation-type RequestResponse --function-name <name> --region <region> --log-type Tail --payload '{"dummy":"dummyvalue"}' outputfile.txt<commit_msg>make run script use env variables<commit_after>printf "\nbuild d app\n"
cd d/alexa-openwebif
dub build

printf "\nbuild zip\n"
zip -j arch.zip ../../node/index.js libssl.so.10 libevent-2.0.so.5 libcrypto.so.10 libevent_pthreads-2.0.so.5 alexa-openwebif

printf "\nupload zip\n"
aws lambda update-function-code --function-name $AWS_LAMBDA_NAME --zip-file fileb://./arch.zip

printf "\nset environment\n"
aws lambda update-function-configuration --function-name $AWS_LAMBDA_NAME --environment "Variables={OPENWEBIF_URL=$OPENWEBIF_URL}"

printf "\ntest invoke\n"
cd ../../
aws lambda invoke --invocation-type RequestResponse --function-name $AWS_LAMBDA_NAME --region $AWS_REGION --log-type Tail --payload '{"dummy":"dummyvalue"}' outputfile.txt
{'fraction_non_alphanumeric': 0.1575673807878369, 'fraction_numerical': 0.013821700069108501, 'mean_word_length': 4.098591549295775, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1909768', 'n_tokens_mistral': 507, 'n_tokens_neox': 497, 'n_words': 120}