|
1 | | -variables: |
2 | | - BRANCH_NAME: $CI_COMMIT_BRANCH |
3 | | - SONAR_BRANCH: -Dsonar.branch.name=$CI_COMMIT_BRANCH |
4 | | - SONAR_UNIT_TEST_REPORT: df_out/reports/sonar_qube_ut_coverage_report.xml |
5 | | - COBERTURA_UNIT_TEST_REPORT: df_out/reports/cobertura.xml |
6 | | - |
7 | | -image: |
8 | | - name: dss-build_$BRANCH_NAME |
9 | | - |
10 | | -workflow: |
11 | | - rules: |
12 | | - - if: $CI_PIPELINE_SOURCE == "merge_request_event" |
13 | | - variables: |
14 | | - BRANCH_NAME: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME |
15 | | - SONAR_BRANCH: '' |
16 | | - - if: $CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "push" |
17 | | - - if: $CI_COMMIT_BRANCH =~ /^(stable|feature)\/.*/ && $CI_PIPELINE_SOURCE == "push" |
| 1 | +include: |
| 2 | + - local: .gitlab/defaults.yml |
18 | 3 |
|
19 | 4 | stages: |
20 | 5 | - build |
| 6 | + - deploy |
21 | 7 | - lint |
22 | 8 | - test |
23 | 9 | - scan |
| 10 | + - coverage |
24 | 11 | - archive |
| 12 | + - sync |
25 | 13 |
|
26 | | -build dss-sdk: |
27 | | - stage: build |
28 | | - script: |
29 | | - # Download build wrapper from local SonarQube |
30 | | - - rm -rf /build-wrapper-linux-x86 |
31 | | - - wget --no-verbose --content-disposition -E -c "$SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip" |
32 | | - - unzip -q build-wrapper-linux-x86.zip -d / |
33 | | - # Disable ssl verify from docker build env |
34 | | - - git config --global http.sslVerify false |
35 | | - # Build client with build-wrapper |
36 | | - - /build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output/ ./scripts/build_all.sh kdd-samsung-remote |
37 | | - variables: |
38 | | - GIT_SUBMODULE_STRATEGY: recursive |
39 | | - artifacts: |
40 | | - name: release build |
41 | | - expire_in: 300 seconds |
42 | | - paths: |
43 | | - - bw-output |
44 | | - - df_out |
45 | | - - host_out |
46 | | - |
47 | | -build target gcov and execute unit tests: |
48 | | - stage: build |
49 | | - script: ./target/build.sh --run-tests --with-coverage |
50 | | - artifacts: |
51 | | - name: gcov build |
52 | | - expire_in: 300 seconds |
53 | | - paths: |
54 | | - - df_out |
55 | | - variables: |
56 | | - GIT_SUBMODULE_STRATEGY: recursive |
57 | | - |
58 | | -target unit test coverage report: |
59 | | - stage: test |
60 | | - script: |
61 | | - - gcovr --xml $COBERTURA_UNIT_TEST_REPORT -r target/ df_out/ |
62 | | - - sed -i -r 's/filename="/filename="target\//g' $COBERTURA_UNIT_TEST_REPORT |
63 | | - - sed -i -r 's/path="/path="target\//g' $SONAR_UNIT_TEST_REPORT |
64 | | - artifacts: |
65 | | - name: target unit test coverage report |
66 | | - expire_in: 300 seconds |
67 | | - paths: |
68 | | - - $SONAR_UNIT_TEST_REPORT |
69 | | - reports: |
70 | | - coverage_report: |
71 | | - coverage_format: cobertura |
72 | | - path: $COBERTURA_UNIT_TEST_REPORT |
73 | | - needs: |
74 | | - - build target gcov and execute unit tests |
75 | | - |
76 | | -sonar-scanner: |
77 | | - stage: scan |
78 | | - script: |
79 | | - # Download latest sonar-scanner from sonar-source |
80 | | - - rm -rf /sonar-scanner* |
81 | | - - wget --no-verbose --content-disposition -E -c "https://search.maven.org/remote_content?g=org.sonarsource.scanner.cli&a=sonar-scanner-cli&v=LATEST&c=linux&e=zip" |
82 | | - - unzip -q sonar-scanner-cli-*.zip -d / |
83 | | - # Scan with sonar-scanner |
84 | | - - /sonar-scanner-*-linux/bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.coverageReportPaths=$SONAR_UNIT_TEST_REPORT |
85 | | - allow_failure: true |
86 | | - dependencies: |
87 | | - - build dss-sdk |
88 | | - - target unit test coverage report |
89 | | - |
90 | | -pycodestyle: |
91 | | - stage: lint |
92 | | - script: git ls-files '*.py' | xargs -n1 pycodestyle --config=./scripts/pycodestyle --show-source --show-pep8 |
93 | | - needs: [] |
94 | | - |
95 | | -shellcheck: |
96 | | - stage: lint |
97 | | - script: git ls-files '*.sh' | xargs -n1 shellcheck |
98 | | - needs: [] |
99 | | - |
100 | | -archive dss-sdk: |
101 | | - stage: archive |
102 | | - script: /stagemergeartifacts.sh |
| 14 | +deploy DSS: |
| 15 | + stage: deploy |
103 | 16 | variables: |
104 | | - DSSGLOBLIST: "nkv-sdk-*.tgz nkv-target-*.tgz" |
105 | | - needs: |
106 | | - - build dss-sdk |
107 | | - artifacts: |
108 | | - name: release artifacts |
109 | | - paths: |
110 | | - - df_out/nkv-target-*.tgz |
111 | | - - host_out/nkv-sdk-bin-*.tgz |
| 17 | + BRANCH_NAME: $BRANCH_NAME |
| 18 | + UPSTREAM_REF: $CI_MERGE_REQUEST_REF_PATH |
| 19 | + trigger: |
| 20 | + include: |
| 21 | + project: dfs/dss/dss-ansible |
| 22 | + ref: master |
| 23 | + file: .gitlab-ci.yml |
| 24 | + strategy: depend |
| 25 | + resource_group: inv_$CI_PROJECT_NAME.ini |
| 26 | + rules: |
| 27 | + - !reference [.default_rules, merge_and_push] |
0 commit comments