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
65b00fc9
Commit
65b00fc9
authored
Sep 21, 2016
by
Luis Fernando Gomes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add container_ip when run in boot2docker
parent
c283ee66
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
run
test/run
+16
-8
No files found.
test/run
View file @
65b00fc9
...
...
@@ -21,9 +21,9 @@ if (echo "$OSTYPE" | egrep -qs 'darwin'); then
!
type
-a
"gmktemp"
&>
"/dev/null"
||
MKTEMP_EXEC
=
"gmktemp"
fi
test_project
=
${
1
}
test_dir
=
"
$(
$READLINK_EXEC
-zf
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
))
"
test_dir
=
"
$(
$READLINK_EXEC
-zf
$(
dirname
"
${
0
}
"
))
"
image_dir
=
$(
$READLINK_EXEC
-zf
${
test_dir
}
/..
)
scripts_url
=
"file://
${
image_dir
}
/.s
t
i/bin"
scripts_url
=
"file://
${
image_dir
}
/.s
2
i/bin"
cid_file
=
$(
$MKTEMP_EXEC
-u
--suffix
=
.cid
)
# Since we built the candidate image locally, we don't want S2I to attempt to pull
...
...
@@ -53,8 +53,16 @@ container_ip() {
fi
}
container_port
()
{
if
(
echo
"
$OSTYPE
"
| egrep
-qs
'darwin'
)
;
then
docker inspect
--format
=
'{{(index (index .NetworkSettings.Ports "8080/tcp") 0).HostPort}}'
$(
cat
$cid_file
)
else
echo
$test_port
fi
}
run_s2i_build
()
{
s2i build
--incremental
=
true
${
s
t
i_args
}
file://
${
test_dir
}
/
${
test_project
}
${
IMAGE_NAME
}
${
IMAGE_NAME
}
-
${
test_project
}
s2i build
--incremental
=
true
${
s
2
i_args
}
file://
${
test_dir
}
/
${
test_project
}
${
IMAGE_NAME
}
${
IMAGE_NAME
}
-
${
test_project
}
}
prepare
()
{
...
...
@@ -114,7 +122,7 @@ wait_for_cid() {
test_s2i_usage
()
{
info
"Testing the 'sti usage' command"
s2i usage
${
s
t
i_args
}
${
IMAGE_NAME
}
&>/dev/null
s2i usage
${
s
2
i_args
}
${
IMAGE_NAME
}
&>/dev/null
}
test_docker_run_usage
()
{
...
...
@@ -123,19 +131,19 @@ test_docker_run_usage() {
}
test_connection
()
{
info
"Testing the HTTP connection (http://
$(
container_ip
)
:
$
{
test_port
}
)"
info
"Testing the HTTP connection (http://
$(
container_ip
)
:
$
(
container_port
)
)"
local
max_attempts
=
10
local
sleep_time
=
1
local
attempt
=
1
local
result
=
1
while
[
$attempt
-le
$max_attempts
]
;
do
echo
"Sending GET request to http://
$(
container_ip
)
:
${
test_port
}
/"
info
"Sending GET request to http://
$(
container_ip
)
:
$(
container_port
)
/"
if
(
echo
"
$OSTYPE
"
| egrep
-qs
'darwin'
)
;
then
echo
"Warning for OSX users: if you can't access the container's IP
${
container_ip
}
directly (because you use boot2docker for example)"
echo
"you should run the curl command in a container, for example using:"
echo
"docker run --rm -it sequenceiq/alpine-curl curl -s -w %{http_code} -o /dev/null http://
$(
container_ip
)
:
$
{
test_port
}
/"
echo
"docker run --rm -it sequenceiq/alpine-curl curl -s -w %{http_code} -o /dev/null http://
$(
container_ip
)
:
$
(
container_port
)
/"
fi
response_code
=
$(
curl
-s
-w
%
{
http_code
}
-o
/dev/null http://
$(
container_ip
)
:
$
{
test_port
}
/
)
response_code
=
$(
curl
-s
-w
%
{
http_code
}
-o
/dev/null http://
$(
container_ip
)
:
$
(
container_port
)
/
)
status
=
$?
if
[
$status
-eq
0
]
;
then
if
[
$response_code
-eq
200
]
;
then
...
...
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