Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
springboot-maven3-centos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luiz.nunes
springboot-maven3-centos
Commits
a5c3b212
Commit
a5c3b212
authored
Mar 23, 2016
by
Benedikt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass test project to test script
parent
1cd17456
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
Makefile
Makefile
+2
-1
run
test/run
+12
-7
No files found.
Makefile
View file @
a5c3b212
...
...
@@ -6,4 +6,5 @@ build:
.PHONY
:
test
test
:
docker build
-t
$(IMAGE_NAME)
-candidate
.
IMAGE_NAME
=
$(IMAGE_NAME)
-candidate
test
/run
IMAGE_NAME
=
$(IMAGE_NAME)
-candidate
test
/run test-app
IMAGE_NAME
=
$(IMAGE_NAME)
-candidate
test
/run test-app-mvnw
test/run
View file @
a5c3b212
...
...
@@ -8,6 +8,11 @@
#
IMAGE_NAME
=
${
IMAGE_NAME
-codecentric/springboot-maven3-centos-candidate
}
if
[
$#
-eq
0
]
;
then
echo
"ERROR: No test project name has been passed."
exit
1
fi
test_project
=
${
1
}
test_dir
=
"
$(
readlink
-zf
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
))
"
image_dir
=
$(
readlink
-zf
${
test_dir
}
/..
)
scripts_url
=
"file://
${
image_dir
}
/.sti/bin"
...
...
@@ -37,7 +42,7 @@ container_ip() {
}
run_s2i_build
()
{
s2i build
${
sti_args
}
file://
${
test_dir
}
/
test-app
${
IMAGE_NAME
}
${
IMAGE_NAME
}
-testapp
s2i build
${
sti_args
}
file://
${
test_dir
}
/
${
test_project
}
${
IMAGE_NAME
}
${
IMAGE_NAME
}
-
${
test_project
}
}
prepare
()
{
...
...
@@ -48,7 +53,7 @@ prepare() {
# TODO: STI build require the application is a valid 'GIT' repository, we
# should remove this restriction in the future when a file:// is used.
info
"Build the test application image"
pushd
${
test_dir
}
/
test-app
>
/dev/null
pushd
${
test_dir
}
/
${
test_project
}
>
/dev/null
git init
git config user.email
"build@localhost"
&&
git config user.name
"builder"
git add
-A
&&
git commit
-m
"Sample commit"
...
...
@@ -56,7 +61,7 @@ prepare() {
}
run_test_application
()
{
docker run
--rm
--cidfile
=
${
cid_file
}
-p
${
test_port
}
${
IMAGE_NAME
}
-
testapp
docker run
--rm
--cidfile
=
${
cid_file
}
-p
${
test_port
}
${
IMAGE_NAME
}
-
${
test_project
}
}
cleanup
()
{
...
...
@@ -66,16 +71,16 @@ cleanup() {
docker stop
$(
cat
$cid_file
)
fi
fi
if
image_exists
${
IMAGE_NAME
}
-
testapp
;
then
docker rmi
${
IMAGE_NAME
}
-
testapp
if
image_exists
${
IMAGE_NAME
}
-
${
test_project
}
;
then
docker rmi
${
IMAGE_NAME
}
-
${
test_project
}
fi
rm
-rf
${
test_dir
}
/
test-app
/.git
rm
-rf
${
test_dir
}
/
${
test_project
}
/.git
}
check_result
()
{
local
result
=
"
$1
"
if
[[
"
$result
"
!=
"0"
]]
;
then
info
"TEST FAILED (
${
result
}
)"
info
"TEST FAILED
for
${
test_project
}
(
${
result
}
)"
cleanup
exit
$result
fi
...
...
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