Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
deploy:
  # Deploy the generated apk to Data Theorem
  stage: deploy
  before_script:
  # jq will simplify extraction of the upload_url from the upload_init response
  - apt-get --quiet update --yes
  - apt-get --quiet install --yes jq
  script:
  # The plugin needs a valid customer API Key from Data Theorem. To find your API Key, you can connect to https://www.securetheorem.com/sdlc using your Data Theorem user account
  # You should store privately your API Key on gitlab: https://docs.gitlab.com/ee/ci/variables/ 

  # Generate an upload link 
  - export upload_url=$(curl -X POST -H "Authorization:APIKey $DATA_THEOREM_UPLOAD_API_KEY"  --data ""  https://api.securetheorem.com/uploadapi/v1/upload_init | jq -r ".upload_url")
  - echo $upload_url
  # Send the apk at the upload link
  - curl -F file=@<PATH_ToTO_YOUR_FILE> $upload_url

Once the CI/CD uploads are enabled, pre-production scans will be completed automatically. Please note:

...

You can download a complete example here: https://gitlab.com/marcTranzer/test-upload/-/jobs.
This example runs unit test tests on a simple android project, then build an apk and finally deploy it to Data Theorem Mobile.

...