Skip to content
Snippets Groups Projects
Select Git revision
  • 39c57a692e7aee6dfdf0ac4d999d2ded4e318294
  • main default protected
2 results

.gitlab-ci.yml

Blame
  • .gitlab-ci.yml 1.82 KiB
    stages:
      - stagetest
      - training_resources
      - clean_training_resources
    
    # Blocks will be added for each step/day, this could be moved in its own file
    
    stagetest:
      stage: stagetest
      image: python:3
      needs: []
      before_script:
        - cd docs
        - mkdir docs_to_publish
        - cp -r resources/docs/* docs_to_publish/
        - pip install -r requirements
      script:
        - mkdocs build --verbose --site-dir test
      artifacts:
        paths:
          - test
      rules:
        - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
          changes:
            - docs/*
    
    deploy_trainee_repository:
      stage: training_resources
      image: python:3
      tags:
        - compute
        - small
      needs: []
      before_script:
        - cd resources/docs
        - mkdir docs_to_publish
        - cp -r docs/* docs_to_publish/
        - ls -la docs_to_publish/
        - cd ../..
    
        - git config --global user.email "bot@takima.fr"
        - git config --global user.name "TakiBot"
      script:
        - pip install -U python-dotenv
        - pip install GitPython
        - pip install -r ./resources/docs/requirements
        - cd scripts
        - python deploy_trainee_repo.py
      variables:
        GIT_TRAINEE_REPOSITORY: "gitlab.takima.io/school/formation-angular/tp-angular"
      when: manual
      cache:
        paths:
          - .cache/pip
          - venv/
      only:
        - main
    
    clean_trainee_repository:
      stage: clean_training_resources
      image: python:3
      tags:
        - compute
        - small
      before_script:
        - git config --global user.email "bot@takima.fr"
        - git config --global user.name "TakiBot"
      script:
        - pip install -U python-dotenv
        - pip install GitPython