.gitlab-ci.yml 2.37 KB
Newer Older
Daniel Scheffler's avatar
Daniel Scheffler committed
1
before_script:
Daniel Scheffler's avatar
Daniel Scheffler committed
2
3
  # - git lfs pull
  - echo "`which git-lfs`"
Daniel Scheffler's avatar
Daniel Scheffler committed
4

5

6
7
8
9
10
11
12
# Advise GitLab that these environment vars should be loaded from the Variables config.
variables:
    GMS_DB_HOST: SECURE
    GMS_INDEX_HOST: SECURE
    GMS_INDEX_PORT: SECURE


13
14
15
16
17
stages:
    - test
    - deploy


18
test_gms_preprocessing:
19
  stage: test
Daniel Scheffler's avatar
Daniel Scheffler committed
20
  script:
21
22
    - source /root/miniconda3/bin/activate
    - export GDAL_DATA=/root/miniconda3/share/gdal
Daniel Scheffler's avatar
Daniel Scheffler committed
23
    - export PYTHONPATH=$PYTHONPATH:/root  # /root <- directory needed later
24
25
26
    - export GMS_db_host=${GMS_DB_HOST}
    - export GMS_index_host=${GMS_INDEX_HOST}
    - export GMS_index_port=${GMS_INDEX_PORT}
27
28
29
30
31
32
33
34
    # update sicor
    # - conda install -y -q -c conda-forge basemap
    # - rm -rf context/sicor
    # - git clone https://gitext.gfz-potsdam.de/EnMAP/sicor.git ./context/sicor
    # - cd ./context/sicor
    # - make download-tables
    # - python setup.py install
    # - cd ../../
Daniel Scheffler's avatar
Daniel Scheffler committed
35
    # make tests
36
    - pip install nested_dict openpyxl timeout_decorator redis retools redis-semaphore psutil pysptools # FIXME: remove as soon as runner is rebuilt
37
38

    # run tests
39
    - make nosetests
Daniel Scheffler's avatar
Daniel Scheffler committed
40
41
42
43
44
    - make docs
  artifacts:
    paths:
    - htmlcov/
    - docs/_build/html/
45
46
    - nosetests.html
    - nosetests.xml
47
    when: always
Daniel Scheffler's avatar
Daniel Scheffler committed
48

49
50
51
52

test_styles:
  stage: test
  script:
53
54
    - source /root/miniconda3/bin/activate
    - export GDAL_DATA=/root/miniconda3/share/gdal
55
56
57
58
59
60
61
62
63
64
    - export PYTHONPATH=$PYTHONPATH:/root  # /root <- directory needed later
    - make lint
  artifacts:
    paths:
    - tests/linting/flake8.log
    - tests/linting/pycodestyle.log
    - tests/linting/pydocstyle.log
    when: always


65
pages:  # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
Daniel Scheffler's avatar
Daniel Scheffler committed
66
67
  stage: deploy
  dependencies:
68
    - test_gms_preprocessing
Daniel Scheffler's avatar
Daniel Scheffler committed
69
  script:
70
71
72
73
    # Create the public directory
    - rm -rf public
    - mkdir public
    - mkdir -p public/doc
Daniel Scheffler's avatar
Daniel Scheffler committed
74
    - mkdir -p public/coverage
Daniel Scheffler's avatar
Daniel Scheffler committed
75
    - mkdir -p public/nosetests_reports
76
    # Copy over the docs
Daniel Scheffler's avatar
Daniel Scheffler committed
77
    - cp -r docs/_build/html/* public/doc/
78
79
80
81
82
83
84
85
86
    # Copy over the coverage reports
    - cp -r htmlcov/* public/coverage/
    # Copy over the nosetests reports
    - cp nosetests.* public/nosetests_reports/
    # Check if everything is working great
    - ls -al public
    - ls -al public/doc
    - ls -al public/coverage
    - ls -al public/nosetests_reports
Daniel Scheffler's avatar
Daniel Scheffler committed
87
88
89
90
91
92
  artifacts:
    paths:
      - public
    expire_in: 30 days
  only:
    - master