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

truongbb - test ci

parent 9950f8a7
Pipeline #374 passed with stages
in 25 seconds
...@@ -34,27 +34,27 @@ checkout: ...@@ -34,27 +34,27 @@ checkout:
- 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
...@@ -67,23 +67,23 @@ check_quality_gate: ...@@ -67,23 +67,23 @@ check_quality_gate:
- chmod +x ./build-test.sh - chmod +x ./build-test.sh
- ./build-test.sh quality-gate - ./build-test.sh quality-gate
build_up: #build_up:
stage: build_up # stage: build_up
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
send_email: #send_email:
stage: send_email # stage: send_email
only: # only:
- master # - master
# - merge_requests # # - merge_requests
script: # script:
- curl --request POST # - curl --request POST
--url https://api.sendgrid.com/v3/mail/send # --url https://api.sendgrid.com/v3/mail/send
--header 'Authorization:Bearer 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' # --header 'Authorization:Bearer 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'
--header 'Content-Type:application/json' # --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!"}]}' # --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 \ No newline at end of file
...@@ -70,9 +70,8 @@ sub_quality-gate(){ ...@@ -70,9 +70,8 @@ sub_quality-gate(){
content=$(curl --request POST \ content=$(curl --request POST \
--url http://192.168.1.210:9000/api/qualitygates/project_status?projectKey=spring-ci \ --url http://192.168.1.210:9000/api/qualitygates/project_status?projectKey=spring-ci \
--header 'cache-control: no-cache' --header 'content-type: application/json') --header 'cache-control: no-cache' --header 'content-type: application/json' | jq -r '.data')
status=$(jq -r '.data' <<< "${content}" ) echo "body: " ${content}
echo "body: " ${status}
} }
sub_send-email(){ sub_send-email(){
......
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