Search code examples
curlgitlab-ci

How to use curl in gitlab-ci file?


In my gitlab-ci file, I want to use the command curl to get the result of a page and verify its content, but I don't know how to use it.

....................
server:check-quality:
  <<: *all-settings
  stage: check-quality
  <<: *tags_definition
  script:
  - echo "APPEL de CURL"
  - content=($curl http://example.com/sonar/api/qualitygates/project_status?projectKey=com.orange.catalog:feature-m752-conditionequals)
  - echo "content"
  - exit 0
  only:
  - develop
  - /^feature.*$/
  - /^hotfix.*$/

Have you any idea please?


Solution

  • In script you can use curl like

    script:
      - echo "APPEL de CURL"
      - curl http://example.com/sonar/api/qualitygates/project_status?projectKey=com.orange.catalog:feature-m752-conditionequals
      - echo "content"
      - exit 0