-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
147 lines (136 loc) · 4.35 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
variables:
DOCKER_DRIVER: overlay2
DOCKER_VERSION: 18.09.7
RENDER_HOST: myrender
RENDER_PORT: 8080
RENDER_BRANCH: ibeam_msem
prepare_test_data:
stage: build
image: 'python:3.7-bullseye'
cache:
paths:
- tests/test_files
untracked: true
policy: push
script:
- pip install jinja2
- python tests/test_data.py
when: manual
build_render_ws_docker:
cache:
paths:
- tests/test_files
untracked: true
policy: pull
stage: build
image: docker:$DOCKER_VERSION-git
tags:
- docker7
services:
- docker:$DOCKER_VERSION-dind
before_script:
- docker info
- touch tests/test_files/*.n5
script:
- git clone --depth 1 https://github.com/saalfeldlab/render.git render -b $RENDER_BRANCH
- cd render
- sed -i 's/MONGO_HOST=""/MONGO_HOST="mymongo"/' Dockerfile
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin && docker build -t "$CI_REGISTRY_IMAGE"/render --target render-ws . && docker push "$CI_REGISTRY_IMAGE"/render
when: manual
build_render_clientscripts:
stage: build
image: azul/zulu-openjdk:11
before_script:
- apt-get update && apt-get install -y git curl maven
script:
- git clone --depth 1 https://github.com/saalfeldlab/render.git render -b $RENDER_BRANCH
- ./render/render-ws/src/main/scripts/install.sh
- export JAVA_HOME=`readlink -m ./render/deploy/*jdk*`
- mvn package -pl render-ws-java-client -am -DskipTests -f render/pom.xml
cache:
key: render
paths:
- render
untracked: true
policy: push
when: manual
build_test_docker:
stage: build
image: docker:$DOCKER_VERSION-git
tags:
- docker7
services:
- docker:$DOCKER_VERSION-dind
before_script:
- docker info
script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin && docker build -t "$CI_REGISTRY_IMAGE"/rmaddons-test . && docker push "$CI_REGISTRY_IMAGE"/rmaddons-test
when: manual
tests:
image: registry.git.embl.de/schorb/rendermodules-addons/rmaddons-test
stage: test
services:
- name: mongo:4
alias: mymongo
- name: registry.git.embl.de/schorb/rendermodules-addons/render
alias: myrender
variables:
FF_NETWORK_PER_BUILD: 1
COVERAGE_PROCESS_START: 1
RENDER_DIR: ./render
cache:
key: render
paths:
- render
untracked: true
policy: pull
before_script:
# - apt-get update && apt-get install -y git curl wget
# - "curl -X GET --header 'Accept: application/json' 'http://myrender:8080/render-ws/v1/serverProperties'"
# - pip install pymongo
# - python -c "from pymongo import MongoClient; client=MongoClient('mymongo'); print(client.server_info())"
# - chmod 777 -R /opt/conda/
# - useradd testuser
# - su testuser -c 'conda install python=3.7 -y'
# - su testuser -c 'conda install git mobie_utils -c conda-forge -y'
# - pip install render-python
# - pip install git+https://github.com/AllenInstitute/asap-modules/ --no-deps
# - pip install git+https://git.embl.de/schorb/pyem
# - pip install git+https://github.com/mobie/mobie-utils-python --no-deps
# - pip install -r requirements.txt
# - pip install -r test_requirements.txt
# - pip install git+https://github.com/mobie/mobie-utils-python
# - su testuser -c 'mkdir -p $(python -m site --user-site)'
# - su testuser -c 'echo "import coverage" > $(python -m site --user-site)/subprocess_coverage.pth'
# - su testuser -c 'echo "coverage.process_startup()" >> $(python -m site --user-site)/subprocess_coverage.pth'
# - git pull origin $CI_COMMIT_BRANCH
script:
- export JAVA_HOME=`readlink -m ./render/deploy/*jdk*`
- export PATH=$PATH:$JAVA_HOME/bin
# - chmod +rx -R *
# - pwd
# - ls
- coverage run -m pytest
# - coverage combine
- coverage xml
- coverage-badge
- coverage report
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
# rules:
# - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
pages:
image: registry.git.embl.de/schorb/rendermodules-addons/rmaddons-test
stage: deploy
before_script:
- pip install -U sphinx
# - pip install git+https://github.com/AllenInstitute/asap-modules --no-deps
# - pip install git+https://git.embl.de/schorb/pyem
- pip install -r requirements.txt
script:
- sphinx-build -b html docs public
artifacts:
paths:
- public
only:
- main
- doctest