diff --git a/.github/workflows/coverity_scan/build.sh b/.github/workflows/coverity_scan/build.sh index 3becfb98f422..7337a13889a7 100755 --- a/.github/workflows/coverity_scan/build.sh +++ b/.github/workflows/coverity_scan/build.sh @@ -22,10 +22,32 @@ cmake ${GDAL_SOURCE_DIR:=..} \ /tmp/cov-analysis-linux64/bin/cov-build --dir cov-int make "-j$(nproc)" tar czf cov-int.tgz cov-int -curl \ - --form token=$COVERITY_SCAN_TOKEN \ - --form email=$COVERITY_SCAN_EMAIL \ - --form file=@cov-int.tgz \ - --form version=master \ - --form description="`git rev-parse --abbrev-ref HEAD` `git rev-parse --short HEAD`" \ - https://scan.coverity.com/builds?project=GDAL + +apt-get install -y jq + +## Below from https://scan.coverity.com/projects/gdal/builds/new + +# Initialize a build. Fetch a cloud upload url. +curl -X POST \ + -d version=master \ + -d description="$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short HEAD)" \ + -d token=$COVERITY_SCAN_TOKEN \ + -d email=$COVERITY_SCAN_EMAIL \ + -d file_name="cov-int.tgz" \ + https://scan.coverity.com/projects/749/builds/init \ + | tee response + +# Store response data to use in later stages. +upload_url=$(jq -r '.url' response) +build_id=$(jq -r '.build_id' response) + +# Upload the tarball to the Cloud. +curl -X PUT \ + --header 'Content-Type: application/json' \ + --upload-file cov-int.tgz \ + $upload_url + +# Trigger the build on Scan. +curl -X PUT \ + -d token=$COVERITY_SCAN_TOKEN \ + https://scan.coverity.com/projects/749/builds/$build_id/enqueue