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
0a89d0da
Commit
0a89d0da
authored
Jul 30, 2019
by
Bùi Bá Trường
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truongbb - test ci
parent
0898638a
Pipeline
#337
passed with stages
in 23 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
9 deletions
+59
-9
.gitlab-ci.yml
.gitlab-ci.yml
+10
-9
build-test.sh
build-test.sh
+49
-0
No files found.
.gitlab-ci.yml
View file @
0a89d0da
...
...
@@ -8,7 +8,7 @@ before_script:
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
ssh-keyscan -t rsa 192.168.1.201 >> ~/.ssh/known_hosts
#
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
-
whoami
-
unset SSH_ASKPASS
...
...
@@ -22,14 +22,15 @@ build:
-
master
# - merge_requests
script
:
-
cd /root/GitlabRunner/repo/
-
ls
-
rm -rf ./spring-ci
-
git config --global user.name 'truongbb96'
-
git config --global user.email 'truongbb@itsol.vn'
-
git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/spring-ci.git
-
cd ./spring-ci
-
sh ./build.sh
# - ls # test command
# - cd /root/GitlabRunner/repo/
# - ls
# - rm -rf ./spring-ci
# - git config --global user.name 'truongbb96'
# - git config --global user.email 'truongbb@itsol.vn'
# - git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/spring-ci.git
# - cd ./spring-ci
-
sh ./build-test.sh help
send_email
:
stage
:
send_email
...
...
build-test.sh
0 → 100644
View file @
0a89d0da
#!/bin/ bash
set
-e
cmd
=
$(
basename
$0
)
sub_help
(){
echo
"Usage:
$cmd
<sub-command> [options]"
echo
"Sub-commands:"
echo
" help Show help"
echo
" checkout Checkout code from git"
echo
" compile Compile java code"
echo
" sonar-scan Run sonar scanner"
echo
" send-email Send email after stage/pipeline"
echo
""
echo
"For help with each sub-command run:"
echo
"
$cmd
<sub-command> -h|--help"
echo
""
}
sub_checkout
(){
echo
"--------------CHECKING OUT GIT CODE--------------------"
ls
# test command
cd
/root/GitlabRunner/repo/
ls
rm
-rf
./spring-ci-advanced
git config
--global
user.name
'truongbb96'
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--------------------"
}
subcommand
=
$1
case
$subcommand
in
""
|
"-h"
|
"--help"
)
sub_help
;;
*
)
shift
sub_
${
subcommand
}
$@
if
[[
$?
=
127
]]
;
then
echo
"Error: '
$subcommand
' is not a known sub-command."
>
&2
echo
"Run '
$cmd
--help' for a list of known sub-commands."
>
&2
exit
1
fi
;;
esac
\ No newline at end of file
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