This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
63 lines (56 loc) · 1.69 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
# this part should be common and maintained in another repo
include:
- project: lbb/devops/devops-jobs
file: devops.gitlab-ci.yml
# this should be the local file
python-tests:
extends: .devops::test
variables:
DOCKER_COMPOSE_FILENAME: docker-compose.testing.yml
FIX_COVERAGE_FOR_SONAR: "true"
FIX_COVERAGE_FOR_SONAR_RENAMEFOLDER: 's#<source>\/opt\/airflow</source>#<source>\/builds\/lbb-importer\/importer</source>#'
script:
- apt-get update && apt-get install make -y;
- make test;
# fix for coverage test not read by sonar
- if [[ "$FIX_COVERAGE_FOR_SONAR" == "true" ]]; then
- if [[ "$FIX_COVERAGE_FOR_SONAR_RENAMEFOLDER" != "" ]]; then
sed -i $FIX_COVERAGE_FOR_SONAR_RENAMEFOLDER testResults/coverage.xml
- else
echo "No FIX_COVERAGE_FOR_SONAR_RENAMEFOLDER variable defined"
- fi;
- fi;
rules:
- if: $CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_TITLE !~ /Draft.*/
changes:
- importer/**/*
- pyproject.toml
- if: ( $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE != 'schedule' )
changes:
- labonneboite/**/*
- pyproject.toml
sonarqube:
extends: .devops::sonarqube
needs:
- job: python-tests
rules:
- if: ( $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE != 'schedule' )
changes:
- importer/**/*
- pyproject.toml
# recette
build-rec:
extends: .devops::build
variables:
DOCKER_FILE: ${CI_PROJECT_DIR}/docker/Dockerfile
release-rec:
extends: .devops::release-recette
variables:
TARGET_ENV: importer
# production
promote-prod:
extends: .devops::promote
release-prod:
extends: .devops::release-prod
variables:
TARGET_ENV: importer