stages:  
  - build
  - test:scripts
  - test:monitoring
  - test:inputs

build:
  - stage: build
  - python setup.py sdist --dist-dir=build  

test:scripts:
  stage: test:scripts
  script: 
    - vagrant --fixture=scripts -- up
    - vagrant --fixture=scripts -- ssh test-runner -- -tt "cd /vagrant && pytest clmctest/scripts/"
  after_script:
    - vagrant --fixture=scripts -- destroy --force
  when: on_success
  
test:monitoring:
  stage: test:monitoring
  script: 
    - vagrant --fixture=monitoring -- up
    - vagrant --fixture=monitoring -- ssh test-runner -- -tt "cd /vagrant && pytest clmctest/monitoring/"
  after_script:
    - vagrant --fixture=monitoring -- destroy --force   
  when: on_success  
  
test:inputs:
  stage: test:inputs
  script: 
    - vagrant --fixture=inputs -- up
    - vagrant --fixture=inputs -- ssh test-runner -- -tt "cd /vagrant && pytest clmctest/inputs/"
  after_script:
    - vagrant --fixture=inputs -- destroy --force       
  when: on_success