Skip to content

Commit 528d6df

Browse files
committed
chore: generate random file to store output for stencil-push script
1 parent 61ffe8e commit 528d6df

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

stencil-push.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ curl -sS -w "\n" -u $STENCIL_USERNAME:$STENCIL_PASSWORD -X PUT --fail "https://$
5757

5858
ACTION="Upload proto descriptor to stencil service with version number: $project_version"
5959
log_info $ACTION
60-
http_response=$(curl -s -o /tmp/stencil_out.txt -w "%{http_code}" -u $STENCIL_USERNAME:$STENCIL_PASSWORD -X POST "https://$STENCIL_HOSTNAME/v1/descriptors" -F "file=@$file_path" -F "version=$project_version" -F "name=$proto_repo" -F "latest=true" -H "Content-Type: multipart/form-data")
60+
response_filename="/tmp/stencil_out_$( cat /dev/urandom | base64 | tr -cd 'a-f0-9' | head -c 16 ).txt"
61+
http_response=$(curl -s -o $response_filename -w "%{http_code}" -u $STENCIL_USERNAME:$STENCIL_PASSWORD -X POST "https://$STENCIL_HOSTNAME/v1/descriptors" -F "file=@$file_path" -F "version=$project_version" -F "name=$proto_repo" -F "latest=true" -H "Content-Type: multipart/form-data")
6162
if [ $? != 0 ]; then
6263
log_error "curl request failed"
6364
exit 1
6465
elif [[ $http_response =~ ^[4-5][0-9][0-9]$ ]]; then
6566
log_error "status_code:" $http_response
66-
log_error $(cat /tmp/stencil_out.txt)
67-
rm /tmp/stencil_out.txt
67+
log_error $(cat $response_filename)
68+
rm $response_filename
6869
exit 1
6970
fi
7071
trap - EXIT

0 commit comments

Comments
 (0)