Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spring-ci-advanced
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bùi Bá Trường
spring-ci-advanced
Commits
c3bfeda8
Commit
c3bfeda8
authored
Jul 30, 2019
by
Bùi Bá Trường
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truongbb - test ci
parent
e1819e6c
Pipeline
#405
failed
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
25 deletions
+26
-25
.gitlab-ci.yml
.gitlab-ci.yml
+24
-25
stop_job.sh
stop_job.sh
+2
-0
No files found.
.gitlab-ci.yml
View file @
c3bfeda8
...
@@ -17,8 +17,8 @@ variables:
...
@@ -17,8 +17,8 @@ variables:
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
...
@@ -37,27 +37,27 @@ checkout:
...
@@ -37,27 +37,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
...
@@ -68,8 +68,7 @@ check_quality_gate:
...
@@ -68,8 +68,7 @@ check_quality_gate:
-
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
# - export QUALITY_GATE=$(./build-test.sh quality-gate)
-
export QUALITY_GATE=$(./build-test.sh quality-gate)
-
export QUALITY_GATE=0
-
echo $QUALITY_GATE
-
echo $QUALITY_GATE
# force pipeline exit and fail job if QUALITY GATE is FAIL
# force pipeline exit and fail job if QUALITY GATE is FAIL
-
sh ./stop_job.sh
-
sh ./stop_job.sh
...
...
stop_job.sh
View file @
c3bfeda8
#!/usr/bin/env bash
#!/usr/bin/env bash
# stop pipeline if QUALITY GATE is FAIL
if
[[
$QUALITY_GATE
=
0
]]
if
[[
$QUALITY_GATE
=
0
]]
then
then
exit
-1
exit
-1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment