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

truongbb - test ci

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