From e28255e8bac6e98b18bba8eb754b79b6fada7726 Mon Sep 17 00:00:00 2001
From: "Olivier J.N. Bertrand" <olivier.bertrand@uni-bielefeld.de>
Date: Wed, 16 May 2018 18:46:59 +0200
Subject: [PATCH] Revert "Change gitlab ci to a simpler one"

This reverts commit 74549176a2da3417e9658019e3d3bd882ecf6595.
---
 .gitlab-ci.yml | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bf81636..25392d8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,6 +20,10 @@ navipy_install:
   - source venv/bin/activate
   - python3 setup.py bdist_wheel
 
+  artifacts:
+    paths:
+      - venv
+
 flake8:
   stage: test
   script:
@@ -28,16 +32,58 @@ flake8:
   
 navipy_unittest:
   stage: test
+  dependencies: 
+    - navipy_install
     
   script:
+  - source $CI_PROJECT_DIR/venv/bin/activate
   - python3 -m unittest discover navipy
   
+coverage:
+    stage: test
+    script:
+        - pip3 install --user nose
+        - python3 -m nose -c .noserc -q --cover-html-dir=build --cover-html
+        - coverage report -m
+    coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
+    artifacts:
+        paths:
+            - build
+        expire_in: 1 day
 
 doc_build:
   stage: doc_build
   script:
+  - source $CI_PROJECT_DIR/venv/bin/activate
   - pip3 install --user sphinx sphinx_rtd_theme
-  - cd doc ; make html  
+  - cd doc ; make html
+
+  artifacts:
+    paths:
+    - build
   
+  
+pages:
+  stage: deploy
+  before_script:
+    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
+    - 'which rsync || apt-get install rsync -y'
+    - mkdir -p ~/.ssh
+    - eval $(ssh-agent -s)
+    - '[[ -f /.dockerenv ]] && echo -e "Host *ntStrictHostKeyChecking nonn" > ~/.ssh/config'
+    - ssh-add <(echo "$PRIVATE_KEY")
+    
+  script:
+    - ssh -p50022 bolirev@bioneuro77.biologie.uni-bielefeld.de "mkdir -p /fastdata/html/navipy/"
+    - mkdir -p public/coverage
+    - cp -fr docs/build/html/* public/
+    - cp -fr build/* public/coverage/
+
+  dependencies:
+    - coverage
+    
+  artifacts:
+    paths:
+        - public
   only:
   - master
-- 
GitLab