Newer
Older
stage: test
cache:
paths:
- .cache/pre-commit
except:
- schedules
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
before_script:
- pip install pre-commit
script:
- pre-commit run -a
test:
image: python:3.10
stage: test
cache:
paths:
- .cache/pip
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
ARKINDEX_API_SCHEMA_URL: schema.yml
before_script:
- pip install tox
# Download OpenAPI schema from last backend build
- curl https://assets.teklia.com/arkindex/openapi.yml > schema.yml
# Add system deps for opencv
- apt-get update -q
- apt-get install -q -y libgl1
except:
- schedules
script:
- tox
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
# Make sure docs still build correctly
.docs:
image: python:3.10
artifacts:
paths:
- public
before_script:
- pip install -e .[docs]
script:
- mkdocs build --strict --verbose
docs-build:
extends: .docs
stage: build
# Test job outside of tags to ensure the docs still can build before merging
# Does not use the `pages` name, therefore will be ignored by GitLab Pages
except:
- tags
- schedules
pages:
extends: .docs
stage: deploy
only:
- master
- tags
docs-deploy:
image: node:18
stage: deploy
dependencies:
- docs-build
before_script:
- npm install -g surge
except:
- master
- tags
- schedules
environment:
name: ${CI_COMMIT_REF_SLUG}
url: https://${CI_COMMIT_REF_SLUG}-teklia-atr-dan.surge.sh
on_stop: docs-stop-surge
script:
- surge public ${CI_ENVIRONMENT_URL}
docs-stop-surge:
image: node:18
stage: deploy
when: manual
# Do not try to checkout the branch if it was deleted
variables:
GIT_STRATEGY: none
except:
- master
- tags
- schedules
environment:
name: ${CI_COMMIT_REF_SLUG}
url: https://${CI_COMMIT_REF_SLUG}-base-worker-arkindex.surge.sh
action: stop
before_script:
- npm install -g surge
script:
- surge teardown ${CI_ENVIRONMENT_URL}
bump-python-deps:
stage: deploy
image: registry.gitlab.com/teklia/devops:latest
only:
- schedules
script:
- devops python-deps requirements.txt doc-requirements.txt