Loading templates/gitlab-ci-mobsf.yml +3 −3 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ stages: .mobsf-scripts: &mobsf-scripts | # BEGSCRIPT set -e set -eo pipefail function log_info() { echo -e "[\\e[1;94mINFO\\e[0m] $*" Loading Loading @@ -209,7 +209,7 @@ stages: sleep 1 counter=$((counter + 1)) done set -e set -eo pipefail return $result } Loading Loading @@ -378,7 +378,7 @@ stages: set +e http_code=$(curl --max-time 10 -s -X POST --url "${MOBSF_SERVER_URL}/api/v1/scan" --data "scan_type=${scan_type}&file_name=${file_name}&hash=${hash}" -H "Authorization: ${MOBSF_API_KEY}" -o ./out -w '%{http_code}') exit_code=$? set -e set -eo pipefail # exit code 28 (timeout) is allowed as POST /api/v1/scan is synchronous and waits for the scan to terminate if [ ${exit_code} -ne 28 ]; then if [ "${http_code}" -ne 200 ]; then Loading Loading
templates/gitlab-ci-mobsf.yml +3 −3 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ stages: .mobsf-scripts: &mobsf-scripts | # BEGSCRIPT set -e set -eo pipefail function log_info() { echo -e "[\\e[1;94mINFO\\e[0m] $*" Loading Loading @@ -209,7 +209,7 @@ stages: sleep 1 counter=$((counter + 1)) done set -e set -eo pipefail return $result } Loading Loading @@ -378,7 +378,7 @@ stages: set +e http_code=$(curl --max-time 10 -s -X POST --url "${MOBSF_SERVER_URL}/api/v1/scan" --data "scan_type=${scan_type}&file_name=${file_name}&hash=${hash}" -H "Authorization: ${MOBSF_API_KEY}" -o ./out -w '%{http_code}') exit_code=$? set -e set -eo pipefail # exit code 28 (timeout) is allowed as POST /api/v1/scan is synchronous and waits for the scan to terminate if [ ${exit_code} -ne 28 ]; then if [ "${http_code}" -ne 200 ]; then Loading