-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
38 lines (33 loc) · 1.13 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
variables:
ORKG_COMPONENT_NAME: orkg-nlp-api
stages:
- test
- containerize
- release
cache:
paths:
- .cache/pip
- venv
include:
- remote: https://gitlab.com/TIBHannover/gitlab-ci-templates/raw/master/templates/Docker.gitlab-ci.yml
- remote: https://gitlab.com/TIBHannover/gitlab-ci-templates/raw/master/templates/Docker-Release.gitlab-ci.yml
test-api:
stage: test
image: python:3.8
variables:
ENV: "test"
LOG_LEVEL: "debug"
SQLALCHEMY_DATABASE_URI: "postgresql+psycopg2://test:test@localhost:5432/test"
before_script:
- pip install poetry
- poetry install
- source `poetry env info --path`/bin/activate
script:
- pytest
deploy:release:
stage: release
image: buildpack-deps:curl
script:
- curl --fail -X POST -F "token=$PIPELINE_TRIGGER_TOKEN" -F "ref=master" -F "variables[ORKG_COMPONENT_NAME]=$ORKG_COMPONENT_NAME" -F "variables[ORKG_COMPONENT_REF_NAME]=$CI_COMMIT_REF_NAME" -F "variables[ORKG_COMPONENT_REF_NAME]=release" -F "variables[ORKG_COMPONENT_RELEASE_VERSION]=$CI_COMMIT_TAG" https://git.tib.eu/api/v4/projects/1317/trigger/pipeline
rules:
- if: $CI_COMMIT_TAG