...
First, you will need to retrieve your organization's Upload API key from the portal, at https://www.securetheorem.com/sdlc/api_access within the “API Key” section:
Step 2: configuring an upload step in CI/CD
...
Code Block | ||
---|---|---|
| ||
#!/usr/bin/env bash # Fail if any commands fails set -eex maxRetries=3 for (( retry = 0; retry < maxRetries; retry++ )) do # Step 1: get the upload URL echo "Get upload url" step1_response=$(curl -s -w "%{http_code}" -X POST -H "Authorization: APIKey ${DT_UPLOAD_API_KEY}" --data "" https://api.securetheorem.com/uploadapi/v1/upload_init) http_code=${step1_response: -3} response_body=${step1_response::-3} # Check that http status code is 200 [ ! ${http_code} -eq 200 ] && echo ${response_body} && exit 1 upload_url=$(echo ${step1response_responsebody} | cutjq -f 3 -d" " | tr -d '"')r ".upload_url") echo ${upload_url} # Step 2: upload the APK echo "Upload app" step2_response=$(curl -F file=@${SIGNED_BINARY_PATH} ${upload_url}) && echo ${step2_response} --retry 3)&& break done if [ ${retry} -ge ${maxRetries} ]; then echo "Upload failed after ${maxRetries} attempts" exit 1 fi |
Once the CI/CD uploads are enabled, pre-production scans will be completed automatically. Please note:
...