Commit c3bfeda8 authored by Bùi Bá Trường's avatar Bùi Bá Trường

truongbb - test ci

parent e1819e6c
Pipeline #405 failed
......@@ -17,8 +17,8 @@ variables:
stages:
- checkout
# - compile
# - sonnar_scanner
- compile
- sonnar_scanner
- check_quality_gate
- build_up # for merge request
- send_email
......@@ -37,27 +37,27 @@ checkout:
- git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/spring-ci-advanced.git
- cd ./spring-ci-advanced
#compile:
# stage: compile
# only:
# - master
# # - merge_requestsssss
# script:
# - cd /root/GitlabRunner/repo/spring-ci-advanced
# - ls
# - chmod +x ./build-test.sh
# - ./build-test.sh compile
#
#sonnar_scanner:
# stage: sonnar_scanner
# only:
# - master
# # - merge_requests
# script:
# - cd /root/GitlabRunner/repo/spring-ci-advanced
# - ls
# - chmod +x ./build-test.sh
# - ./build-test.sh sonar-scan
compile:
stage: compile
only:
- master
# - merge_requestsssss
script:
- cd /root/GitlabRunner/repo/spring-ci-advanced
- ls
- chmod +x ./build-test.sh
- ./build-test.sh compile
sonnar_scanner:
stage: sonnar_scanner
only:
- master
# - merge_requests
script:
- cd /root/GitlabRunner/repo/spring-ci-advanced
- ls
- chmod +x ./build-test.sh
- ./build-test.sh sonar-scan
check_quality_gate:
stage: check_quality_gate
......@@ -68,8 +68,7 @@ check_quality_gate:
- cd /root/GitlabRunner/repo/spring-ci-advanced
- ls
- chmod +x ./build-test.sh
# - export QUALITY_GATE=$(./build-test.sh quality-gate)
- export QUALITY_GATE=0
- export QUALITY_GATE=$(./build-test.sh quality-gate)
- echo $QUALITY_GATE
# force pipeline exit and fail job if QUALITY GATE is FAIL
- sh ./stop_job.sh
......
#!/usr/bin/env bash
# stop pipeline if QUALITY GATE is FAIL
if [[ $QUALITY_GATE = 0 ]]
then
exit -1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment