Use of rules and variables in gitlab-ci.yml


I would like to achieve something like this :

    stage: staging
      - if: '$CI_PIPELINE_SOURCE == "web" && $CI_ENVIRONMENT_NAME == "staging"'
        when: always
      - if: '$CI_PIPELINE_SOURCE == "triggers" && $STAGE == "staging"'
        when: always
    image: python:3.7-stretch

Triggering pipeline through web with CI_ENVIRONMENT_NAME set to staging is working as expected, however I’m not able to trigger the pipeline with cURL (second test case)

I’m using :
curl -X POST -F token="" -F ref=master -F “variables[STAGE]=staging”

What I am missing ? Thanks.

Fixed! trigger is without s

1 Like