# Rules for where jobs can run

.run_automatically:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: on_success
        - if: '$CI_PROJECT_PATH == "vtk/vtk"'
          when: on_success
        - when: never

.run_scheduled:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: manual
        - if: '$CI_COMMIT_TAG && $CI_PROJECT_PATH == "vtk/vtk"'
          when: on_success
        - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_PATH == "vtk/vtk"'
          when: on_success
        - when: never

.run_manually:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: manual
        - if: '$CI_PROJECT_PATH == "vtk/vtk" && $CI_PIPELINE_SOURCE == "schedule"'
          when: on_success
        - if: '$CI_PROJECT_PATH == "vtk/vtk"'
          when: delayed
          start_in: 30 minutes
        - when: never

.merged_only:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: never
        - if: '$CI_PROJECT_PATH == "vtk/vtk"'
          when: on_success
        - when: never

.upload_only:
    rules:
      - if: '$RSYNC_UPLOAD_ENABLE == "true"'
        when: on_success
      - when: never

.weekly_upload_only:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: never
        - if: '$CI_PROJECT_PATH == "vtk/vtk" && $CI_COMMIT_TAG'
          when: on_success
        - if: '$PYPI_WEEKLY_UPLOAD == "true"'
          when: on_success
        - when: never

.tag_only:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: never
        - if: '$CI_PROJECT_PATH == "vtk/vtk" && $CI_COMMIT_TAG'
          when: on_success
        - when: never
