Skip to content
Snippets Groups Projects
Select Git revision
  • 382dc40b08e8df50996e37a0ab80e8802f1de7bc
  • main default
  • tp2
  • tp1
  • tp3
  • tp3-correction
  • tp2-correction
  • tp1-correction
  • admins
9 results

.gitlab-ci.yml

Blame
  • Forked from an inaccessible project.
    .gitlab-ci.yml 987 B
    image: python:3.10
    
    stages:
      - dependencies
      - lint
      - test
      - deploy
    
    download_dependencies:
      stage: dependencies
      script:
        - python -m venv .venv
        - source .venv/bin/activate
        - pip install -r requirements.txt
      artifacts:
        paths:
          - .venv
    
    pylint:
      stage: lint
      dependencies:
        - download_dependencies
      needs:
        - download_dependencies
      script:
        - source .venv/bin/activate
        - pip install pylint
        - pylint calculator --fail-on=error
    
    pytest:
      stage: test
      dependencies:
        - download_dependencies
      needs:
        - download_dependencies
      script:
        - source .venv/bin/activate
        - pip install pytest
        - pytest calculator
    
    deploy:
      stage: deploy
      needs:
        - pylint
        - pytest
      script:
        - apt-get update
        - apt-get install -y openssh-client sshpass
        - sshpass -p <mot-de-passe> ssh -o StrictHostKeyChecking=no <nom-d'utilisateur>@<ip-de-ma-vm>
          "cd /var/www/cicd && sudo git pull && sudo systemctl restart calculator"