Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.66 KiB
image: alpine:latest

stages:
  - deploy

before_script:
  - apk add --no-cache curl

deploy-draft-students:
  stage: deploy
  script:
    - |
      curl -X POST https://mude.citg.tudelft.nl/hooks/files-sync-students-draft \
        -H "Content-Type: application/json" \
        -H "X-Gitlab-Token: glpat-Lohnt8MN6nWzpcwyhprL" \
        -d '{
          "object_kind": "pipeline",
          "object_attributes": {
            "status": "success",
            "ref": "main"
          }
        }'
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      changes:
        - src/students/**/*
      when: always

deploy-teachers:
  stage: deploy
  script:
    - |
      curl -X POST https://mude.citg.tudelft.nl/hooks/files-sync-teachers \
        -H "Content-Type: application/json" \
        -H "X-Gitlab-Token: glpat-Lohnt8MN6nWzpcwyhprL" \
        -d '{
          "object_kind": "pipeline",
          "object_attributes": {
            "status": "success",
            "ref": "main"
          }
        }'
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      changes:
        - src/teachers/**/*
      when: always

deploy-production-students:
  stage: deploy
  script:
    - |
      curl -X POST https://mude.citg.tudelft.nl/hooks/files-sync-students \
        -H "Content-Type: application/json" \
        -H "X-Gitlab-Token: glpat-Lohnt8MN6nWzpcwyhprL" \
        -d '{
          "object_kind": "pipeline",
          "object_attributes": {
            "status": "success",
            "ref": "release"
          }
        }'
  rules:
    - if: $CI_COMMIT_BRANCH == "release"
      changes:
        - src/students/**/*
      when: always