Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.27 KiB
Newer Older
MJB's avatar
MJB committed
variables:
MJB's avatar
MJB committed
  TEST_PACKAGE_NAME: clmctest-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA-.tar.gz
MJB's avatar
MJB committed

MJB's avatar
MJB committed
stages:  
MJB's avatar
MJB committed
  - build
MJB's avatar
MJB committed
  - clean
MJB's avatar
MJB committed

build:tests:
  stage: build
  script:
MJB's avatar
MJB committed
    - echo $TEST_PACKAGE_NAME
MJB's avatar
MJB committed
    - echo "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA" > clmctest/git-commit-ref  
    - python setup.py sdist --dist-dir=build
MJB's avatar
MJB committed
  artifacts:
    paths:
MJB's avatar
MJB committed
    - build/$TEST_PACKAGE_NAME
MJB's avatar
MJB committed
    expire_in: 1 day
test:
  stage: test
MJB's avatar
MJB committed
  dependencies: build:test
MJB's avatar
MJB committed
  script: 
Michael Boniface's avatar
Michael Boniface committed
    - vagrant --fixture=scripts -- up
MJB's avatar
MJB committed
    - vagrant --fixture=scripts -- ssh test-runner -- -tt "pip3 install /vagrant/build/$TEST_PACKAGE_NAME"
MJB's avatar
MJB committed
    - vagrant --fixture=scripts -- ssh test-runner -- -tt "pytest -s --pyargs clmctest.scripts"
    - vagrant --fixture=monitoring -- up
MJB's avatar
MJB committed
    - vagrant --fixture=monitoring -- ssh test-runner -- -tt "pytest -s --pyargs clmctest.monitoring"  
MJB's avatar
MJB committed
    - vagrant --fixture=scripts -- ssh test-runner -- -tt "pytest -s --pyargs clmctest.inputs"         
MJB's avatar
MJB committed
  when: manual   
MJB's avatar
MJB committed

clean:
  stage: clean
  script: 
    - vagrant --fixture=scripts -- ssh test-runner -- -tt "pip3 uninstall -y clmctest"    
    - vagrant --fixture=inputs -- destroy --force     
    - vagrant --fixture=monitoring -- destroy --force     
    - vagrant --fixture=scripts -- destroy --force
MJB's avatar
MJB committed
  when: on_failure