-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
122 lines (122 loc) · 4.2 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
122 lines (122 loc) · 4.2 KB
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
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
variables:
GIT_SSL_NO_VERIFY: '1'
GIT_SUBMODULE_STRATEGY: recursive
workflow:
rules:
- if: $CI_COMMIT_BRANCH
stages:
- build
- test
- deploy
- review
- dast
- staging
- canary
- production
- incremental rollout 10%
- incremental rollout 25%
- incremental rollout 50%
- incremental rollout 100%
- performance
- cleanup
docker-build:
image: docker:latest
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
cache:
key:
files:
- conanfile.in
paths:
- .conan
when: always
artifacts:
paths:
- install
- build
- build-gcov
stage: build
services:
- docker:dind
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker pull $CI_REGISTRY_IMAGE${tag} || true
- docker build --cache-from $CI_REGISTRY_IMAGE${tag} --tag $CI_REGISTRY_IMAGE${tag} .
- docker create --name glshaderpp_container "$CI_REGISTRY_IMAGE${tag}"
- docker cp glshaderpp_container:/root/.conan ./.conan
- docker cp glshaderpp_container:/root/glshaderPP/install ./install
- docker cp glshaderpp_container:/root/glshaderPP/build ./build
- docker cp glshaderpp_container:/root/glshaderPP/build-gcov ./build-gcov
- docker container rm glshaderpp_container
- docker push "$CI_REGISTRY_IMAGE${tag}"
rules:
- exists:
- Dockerfile
docker-test:
image: docker:latest
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
GIT_STRATEGY: none
artifacts:
paths:
- testProg_coverage
stage: test
coverage: '/^lines: \d+\.\d+/'
dependencies:
- docker-build
services:
- docker:dind
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker pull $CI_REGISTRY_IMAGE${tag}
- docker run --rm $CI_REGISTRY_IMAGE${tag} sh -c "Xvfb -screen 0 1280x1024x24 -ac -nolisten unix& cd build && NBPROCS=`cat /proc/cpuinfo | grep processor | wc -l` && ctest -j $NBPROCS"
- docker run --name glshaderpp_test_container $CI_REGISTRY_IMAGE${tag} sh -c "Xvfb -screen 0 1280x1024x24 -ac -nolisten unix& cd build-gcov/test && NBPROCS=`cat /proc/cpuinfo | grep processor | wc -l` && ctest -j $NBPROCS && mkdir testProg_coverage && gcovr --html testProg_coverage/index.html --html-details -r /root/glshaderPP -e '/root/glshaderPP/test/*' --object-directory=/root/glshaderPP/build-gcov/test -s"
- docker cp glshaderpp_test_container:/root/glshaderPP/build-gcov/test/testProg_coverage ./testProg_coverage
- docker container rm glshaderpp_test_container
docker-deploy:
image: docker:latest
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
GIT_STRATEGY: none
stage: deploy
dependencies:
- docker-build
artifacts:
paths:
- install
script: echo Does nothing
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml