-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
112 lines (102 loc) · 3.39 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
# CI config
# shared key for the python jobs to not have redundant config parameters
# PROJECT, TESTSDIR, SRCDIR are used in the tox.ini
# cp -no-clobber copies files but doesn't overwrite existing ones (e.g. sonar property settings)
.python_defaults: &py_anchor # using anchor magic
image: registry.gitlab.semanticlab.net/docker/py3full:3.8
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive --remote
- cp --no-clobber wl_python_utils/python3/* .
- sed -i s/-dev/".$(date +%Y%m%d.%H%M)"/g setup.py
- export PROJECT=$(/usr/bin/python3 -W ignore ./setup.py --name | awk 'NR==1{print $1}')
- export VERSION=$(/usr/bin/python3 -W ignore ./setup.py --version | awk 'NR==1{print $1}')
- export TESTSDIR=src/python/weblyzard_api/tests/always_run/
- export SRCDIR=src/python/weblyzard_api/
tags:
- docker
stages:
- test-python
- test-java
- deploy
- build-package
pytest:
<<: *py_anchor # we reference the anchor here
stage: test-python
only:
- branches
script:
- tox -q -e pytest
- sonar-scanner -D sonar.host.url=${sonarhost} -D sonar.login=${sonarlogin}
pylint:
<<: *py_anchor
stage: test-python
only:
- branches
script:
- tox -q -e pylint
when: manual
vulture:
<<: *py_anchor
stage: test-python
only:
- branches
script:
- tox -q -e vulture
when: manual
# the sed and exports needed are in the actual build-package.sh
build:
stage: build-package
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive --remote
- cp --no-clobber wl_python_utils/python3/* .
- sed -i s/-dev/".$(date +%Y%m%d.%H%M)"/g setup.py
script:
- chmod +x build-package.sh
- ./build-package.sh
- echo ':triggering build of py3full'
- curl -X POST -F token=$PY3FULL_TOKEN -F ref=master https://gitlab.semanticlab.net/api/v4/projects/650/trigger/pipeline
only:
- master
tags:
- shell-runner
sonarqube_preview:
script:
- git checkout origin/master
- git merge $CI_COMMIT_SHA --no-commit --no-ff
- export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dmaven.test.failure.ignore=false -U -DskipITs -Dgpg.skip
- mvn --batch-mode verify sonar:sonar -Dsonar.branch.name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_SHA -DskipITs -Dgpg.skip
stage: test-java
except:
- develop
- master
- /^hotfix_.*$/
- /.*-hotfix$/
tags:
- java10
sonarqube:
script:
- export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dmaven.test.failure.ignore=false -U -DskipITs -Dgpg.skip
- mvn --batch-mode verify sonar:sonar -DskipITs -Dgpg.skip
stage: test-java
only:
- master
- develop
tags:
- java10
code_semanticlab_net_deploy:
script:
- pwd
- echo "=================================="
- export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
- mvn clean
- mvn deploy -U -DskipITs -Dgpg.skip
- echo "=================================="
stage: deploy
only:
- master
tags:
- java10