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
31fe49d1
Commit
31fe49d1
authored
Aug 01, 2019
by
Bùi Bá Trường
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truongbb - test ci
parent
2740508e
Pipeline
#491
passed with stages
in 2 minutes and 14 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
94 deletions
+77
-94
.gitlab-ci.yml
.gitlab-ci.yml
+73
-85
build-test.sh
build-test.sh
+0
-9
src/main/java/vn/itsol/springci/repository/StudentRepositoryImpl.java
...a/vn/itsol/springci/repository/StudentRepositoryImpl.java
+4
-0
No files found.
.gitlab-ci.yml
View file @
31fe49d1
...
...
@@ -14,13 +14,12 @@ variables:
stages
:
-
checkout_code
# - compile
# - sonnar_scanner
# - check_quality_gate
# - docker_build
# - docker_up
# - docker_push
# - send_email
-
compile
-
sonnar_scanner
-
check_quality_gate
-
docker_build
-
docker_up
-
docker_push
checkout_code
:
stage
:
checkout_code
...
...
@@ -32,82 +31,71 @@ checkout_code:
-
git stash
-
git pull
#compile:
# stage: compile
# only:
# - master
# - merge_request
# 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
# only:
# - master
# - merge_requests
# script:
# - cd /root/GitlabRunner/repo/spring-ci-advanced
# - ls
# - chmod +x ./build-test.sh
# - export QUALITY_GATE=$(./build-test.sh quality-gate)
# - echo $QUALITY_GATE
# - echo "Sonar statistic result at --> http://192.168.1.210:9000/dashboard?id=spring-ci-advanced"
# - sh ./stop_job.sh # force pipeline exit and fail job if QUALITY GATE is FAIL
#
#docker_build:
# stage: docker_build
# only:
# - master
# # - merge_requesttt
# script:
# - cd /root/GitlabRunner/repo/spring-ci-advanced
# - ls
# - chmod +x ./build-test.sh
# - ./build-test.sh docker-build
#
#docker_up:
# stage: docker_up
# only:
# - master
# # - merge_request
# script:
# - cd /root/GitlabRunner/repo/spring-ci-advanced
# - ls
# - chmod +x ./build-test.sh
# - ./build-test.sh docker-up
#
#docker_push:
# stage: docker_push
# only:
# - master
# # - merge_request
# script:
# - cd /root/GitlabRunner/repo/spring-ci-advanced
# - ls
# - chmod +x ./build-test.sh
# - ./build-test.sh docker-push
compile
:
stage
:
compile
only
:
-
master
-
merge_request
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
only
:
-
master
-
merge_requests
script
:
-
cd /root/GitlabRunner/repo/spring-ci-advanced
-
ls
-
chmod +x ./build-test.sh
-
export QUALITY_GATE=$(./build-test.sh quality-gate)
-
echo $QUALITY_GATE
-
echo "Sonar statistic result at --> http://192.168.1.210:9000/dashboard?id=spring-ci-advanced"
-
sh ./stop_job.sh
# force pipeline exit and fail job if QUALITY GATE is FAIL
#send_email:
# stage: send_email
# only:
# - master
# - merge_requests
# script:
# - cd /root/GitlabRunner/repo/spring-ci-advanced
# - ls
# - chmod +x ./build-test.sh
# - ./build-test.sh send-email
\ No newline at end of file
docker_build
:
stage
:
docker_build
only
:
-
master
# - merge_requesttt
script
:
-
cd /root/GitlabRunner/repo/spring-ci-advanced
-
ls
-
chmod +x ./build-test.sh
-
./build-test.sh docker-build
docker_up
:
stage
:
docker_up
only
:
-
master
# - merge_request
script
:
-
cd /root/GitlabRunner/repo/spring-ci-advanced
-
ls
-
chmod +x ./build-test.sh
-
./build-test.sh docker-up
docker_push
:
stage
:
docker_push
only
:
-
master
# - merge_request
script
:
-
cd /root/GitlabRunner/repo/spring-ci-advanced
-
ls
-
chmod +x ./build-test.sh
-
./build-test.sh docker-push
\ No newline at end of file
build-test.sh
View file @
31fe49d1
...
...
@@ -15,7 +15,6 @@ sub_help(){
echo
" docker-build Build project with docker"
echo
" docker-up Start services via docker"
echo
" docker-push Push image to Nexus repository via docker"
echo
" send-email Send email after stage/pipeline"
echo
""
echo
"For help with each sub-command run:"
echo
"
$cmd
<sub-command> -h|--help"
...
...
@@ -98,14 +97,6 @@ sub_docker-push(){
docker-compose
-f
deploy/docker-compose.yml push
}
sub_send-email
(){
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!"}]}'
}
_docker_mvn
()
{
docker run
-i
--rm
\
-v
"
$PWD
:/usr/src/"
\
...
...
src/main/java/vn/itsol/springci/repository/StudentRepositoryImpl.java
View file @
31fe49d1
...
...
@@ -10,6 +10,10 @@ import java.util.List;
public
class
StudentRepositoryImpl
implements
StudentRepository
{
@Override
public
List
<
Student
>
getAll
()
{
try
{
int
a
=
1
/
0
;
}
catch
(
Exception
e
)
{
}
return
Arrays
.
asList
(
new
Student
(
1
,
"Nguyen Van 1"
,
"Ha Noi 1"
),
new
Student
(
1
,
"Nguyen Van 2"
,
"Ha Noi 2"
),
...
...
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