forked from MarketSquare/robotframework-camunda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
124 lines (112 loc) · 3.02 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
# You can override the included template(s) by including variable overrides
# See https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
stages:
- build
- test
- deploy
image: "$FEATURE_IMAGE_NAME:runtime"
# scan for secret spoiling in project
include:
- template: Secret-Detection.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
variables:
FEATURE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG"
DEPLOY_IMAGE_NAME: "$CI_REGISTRY_IMAGE"
Build environment:
stage: build
image: docker:19.03.12
services:
- name: docker:dind
variables:
DOCKER_DRIVER: overlay2
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $DEPLOY_IMAGE_NAME/master:runtime || true
- docker pull $FEATURE_IMAGE_NAME:runtime || true
- |
docker build \
--cache-from $FEATURE_IMAGE_NAME:runtime \
-t $FEATURE_IMAGE_NAME:runtime \
--target runtime \
.
- docker push $FEATURE_IMAGE_NAME:runtime
Unittests:
stage: test
before_script:
- pip install -U unittest-xml-reporting
script:
- python CamundaLibrary/CamundaResources.py -v
artifacts:
expire_in: 1 week
paths:
- logs
when: always
reports:
junit: logs/TEST*.xml
Dryrun Robottests:
stage: test
before_script:
- pip install .
script:
- robot -L DEBUG -b console -d output -x xunit.xml --dryrun tests/robot/**/*.robot
artifacts:
expire_in: 1 week
paths:
- output
reports:
junit: output/xunit.xml
when: always
Integrationtests:
stage: test
parallel:
matrix:
- CAMUNDA_VERSION: run-7.14.0
- CAMUNDA_VERSION: run-7.15.0
services:
- name: camunda/camunda-bpm-platform:${CAMUNDA_VERSION}
alias: camunda
before_script:
- pip install .
script:
- robot -L DEBUG -b console -d output -x xunit.xml -v CAMUNDA_HOST:http://camunda:8080 tests/robot/**/test*.robot
artifacts:
expire_in: 1 week
paths:
- output
reports:
junit: output/xunit.xml
when: always
".package and deploy on testpypi":
stage: deploy
script:
- python -m pip install --upgrade setuptools wheel twine
- python setup.py sdist bdist_wheel
- TWINE_PASSWORD=${TEST_PYPI_DEPLOYTOKEN} TWINE_USERNAME=__token__ python -m twine
upload --verbose --repository testpypi dist/*
only:
- tags
package and deploy on pypi:
stage: deploy
script:
- python -m pip install --upgrade setuptools wheel twine
- python setup.py sdist bdist_wheel
- TWINE_PASSWORD=${PYPI_DEPLOYMENT_TOKEN} TWINE_USERNAME=__token__ python -m twine
upload --verbose --repository pypi dist/*
only:
- tags
pages:
stage: deploy
before_script:
- pip install robotframework .
script:
- python libdoc/generate_libdoc.py
artifacts:
paths:
- public
only:
- tags
# do some code analysis
sast:
stage: test