diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d3b42ff62f45304cc305e70a59c5cad9e666384..75194631e746026f57d3eff65568cc469b302ea7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,48 +16,48 @@ variables: QUALITY_GATE: "OK" stages: - - checkout - - compile - - sonnar_scanner +# - checkout +# - compile +# - sonnar_scanner - check_quality_gate - - build_up # for merge request - - send_email +# - build_up # for merge request +# - send_email -checkout: - stage: checkout - only: - - master - script: - - ls # test command - - cd /root/GitlabRunner/repo/ - - ls - - rm -rf ./spring-ci-advanced - - git config --global user.name 'truongbb96' - - git config --global user.email 'truongbb@itsol.vn' - - 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 +#checkout: +# stage: checkout +# only: +# - master +# script: +# - ls # test command +# - cd /root/GitlabRunner/repo/ +# - ls +# - rm -rf ./spring-ci-advanced +# - git config --global user.name 'truongbb96' +# - git config --global user.email 'truongbb@itsol.vn' +# - 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 check_quality_gate: stage: check_quality_gate @@ -71,25 +71,25 @@ check_quality_gate: # - export QUALITY_GATE=$(./build-test.sh quality-gate) - export QUALITY_GATE=0 - echo $QUALITY_GATE - - if [[ $QUALITY_GATE = 0 ]] then exit 0 fi - -build_up: - stage: build_up - only: - # - master - - merge_requests - script: - - cd /root/GitlabRunner/repo/spring-ci-advanced - - ls + - if [[ "$QUALITY_GATE" = 0 ]] then exit 0 fi -send_email: - stage: send_email - only: - - master - # - merge_requests - script: - - curl --request POST - --url https://api.sendgrid.com/v3/mail/send - --header 'Authorization:Bearer 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' - --header 'Content-Type:application/json' - --data '{"personalizations":[{"to":[{"email":"truongbb96@gmail.com"}]}],"from":{"email":"truongbb@itsol.vn"},"subject":"CI pipeline result","content":[{"type":"text/plain","value":"CI pipeline done!"}]}' \ No newline at end of file +#build_up: +# stage: build_up +# only: +# # - master +# - merge_requests +# script: +# - cd /root/GitlabRunner/repo/spring-ci-advanced +# - ls +# +#send_email: +# stage: send_email +# only: +# - master +# # - merge_requests +# script: +# - curl --request POST +# --url https://api.sendgrid.com/v3/mail/send +# --header 'Authorization:Bearer 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' +# --header 'Content-Type:application/json' +# --data '{"personalizations":[{"to":[{"email":"truongbb96@gmail.com"}]}],"from":{"email":"truongbb@itsol.vn"},"subject":"CI pipeline result","content":[{"type":"text/plain","value":"CI pipeline done!"}]}' \ No newline at end of file