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
fb76837b
Commit
fb76837b
authored
Jul 30, 2019
by
Bùi Bá Trường
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truongbb - test ci
parent
640eb733
Pipeline
#380
failed with stages
in 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
.gitlab-ci.yml
.gitlab-ci.yml
+5
-1
build-test.sh
build-test.sh
+9
-8
No files found.
.gitlab-ci.yml
View file @
fb76837b
...
...
@@ -12,6 +12,9 @@ before_script:
-
whoami
-
unset SSH_ASKPASS
variables
:
QUALITY_GATE
:
"
OK"
stages
:
-
checkout
# - compile
...
...
@@ -65,7 +68,8 @@ check_quality_gate:
-
cd /root/GitlabRunner/repo/spring-ci-advanced
-
ls
-
chmod +x ./build-test.sh
-
./build-test.sh quality-gate
-
export QUALITY_GATE = $(./build-test.sh quality-gate)
-
echo $QUALITY_GATE
#build_up:
# stage: build_up
...
...
build-test.sh
View file @
fb76837b
...
...
@@ -12,6 +12,7 @@ sub_help(){
echo
" compile Compile java code"
echo
" sonar-scan Run sonar scanner"
echo
" quality-gate Check quality gate"
echo
" build-up Build project with docker"
echo
" send-email Send email after stage/pipeline"
echo
""
echo
"For help with each sub-command run:"
...
...
@@ -20,7 +21,6 @@ sub_help(){
}
sub_checkout
(){
echo
"--------------CHECKING OUT GIT CODE--------------------"
cd
/root/GitlabRunner/repo/
ls
rm
-rf
./spring-ci-advanced
...
...
@@ -28,13 +28,11 @@ sub_checkout(){
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
echo
"--------------DONE CHECKING OUT GIT CODE--------------------"
}
sub_compile
(){
# mvn install
_docker_mvn compile
-DskipTests
}
sub_sonar-scan
(){
...
...
@@ -50,12 +48,16 @@ sub_quality-gate(){
--url
http://192.168.1.210:9000/api/qualitygates/project_status?projectKey
=
spring-ci
\
--header
'cache-control: no-cache'
--header
'content-type: application/json'
| jq
-r
'.projectStatus.status'
)
echo
"Quality gate status: "
${
qualityGateStatus
}
if
[[
${
qualityGateStatus
}
=
"OK"
]]
if
[[
${
qualityGateStatus
}
!
=
"OK"
]]
then
echo
"OK"
else
echo
"NOK"
# TODO - Fail quality gate --> stop pipeline???
echo
"*******QUALITY GATE FAILED!**********"
fi
return
${
qualityGateStatus
}
}
sub_build-up
(){
echo
"TODO - BUILD UP"
}
sub_send-email
(){
...
...
@@ -71,7 +73,6 @@ _docker_mvn() {
mvn
-U
clean
$@
}
sub_command
=
$1
case
sub_command
in
...
...
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