Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
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
openSource
apollo
Commits
36cdfda0
Commit
36cdfda0
authored
Jun 03, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move back common startup logic
parent
7c2c539d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
201 additions
and
207 deletions
+201
-207
common_startup.sh
apollo-adminservice/src/main/scripts/common_startup.sh
+0
-68
startup.sh
apollo-adminservice/src/main/scripts/startup.sh
+67
-1
common_startup.sh
apollo-configservice/src/main/scripts/common_startup.sh
+0
-68
startup.sh
apollo-configservice/src/main/scripts/startup.sh
+67
-1
common_startup.sh
apollo-portal/src/main/scripts/common_startup.sh
+0
-68
startup.sh
apollo-portal/src/main/scripts/startup.sh
+67
-1
No files found.
apollo-adminservice/src/main/scripts/common_startup.sh
deleted
100644 → 0
View file @
7c2c539d
#!/bin/bash
if
[[
-z
"
$JAVA_HOME
"
&&
-d
/usr/java/latest/
]]
;
then
export
JAVA_HOME
=
/usr/java/latest/
fi
cd
`
dirname
$0
`
/..
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
if
[[
!
-f
PATH_TO_JAR
&&
-d
current
]]
;
then
cd
current
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
fi
if
[[
-f
$SERVICE_NAME
".jar"
]]
;
then
rm
-rf
$SERVICE_NAME
".jar"
fi
ln
$PATH_TO_JAR
$SERVICE_NAME
".jar"
chmod
a+x
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
declare
-i
counter
=
0
declare
-i
max_counter
=
30
# 30*5=150s
declare
-i
total_time
=
0
printf
"Waiting for server startup"
until
[[
((
counter
-ge
max_counter
))
||
"
$(
curl
--silent
--connect-timeout
1
--head
$SERVER_URL
|
grep
"Coyote"
)
"
!=
""
]]
;
do
printf
"."
counter+
=
1
sleep
5
done
total_time
=
counter
*
5
if
[[
((
counter
-ge
max_counter
))
]]
;
then
printf
"
\n
Server failed to start in
$total_time
seconds!
\n
"
exit
1
;
fi
printf
"
\n
Server started in
$total_time
seconds!
\n
"
exit
0
;
apollo-adminservice/src/main/scripts/startup.sh
View file @
36cdfda0
...
...
@@ -8,4 +8,70 @@ export JAVA_OPTS="$JAVA_OPTS -Xloggc:/opt/logs/100003172/heap_trace.txt -XX:Heap
SERVER_PORT
=
8090
SERVER_URL
=
"http://localhost:
$SERVER_PORT
"
source
./common_startup.sh
########### The following is the same for configservice, adminservice, portal ###########
if
[[
-z
"
$JAVA_HOME
"
&&
-d
/usr/java/latest/
]]
;
then
export
JAVA_HOME
=
/usr/java/latest/
fi
cd
`
dirname
$0
`
/..
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
if
[[
!
-f
PATH_TO_JAR
&&
-d
current
]]
;
then
cd
current
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
fi
if
[[
-f
$SERVICE_NAME
".jar"
]]
;
then
rm
-rf
$SERVICE_NAME
".jar"
fi
ln
$PATH_TO_JAR
$SERVICE_NAME
".jar"
chmod
a+x
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
declare
-i
counter
=
0
declare
-i
max_counter
=
30
# 30*5=150s
declare
-i
total_time
=
0
printf
"Waiting for server startup"
until
[[
((
counter
-ge
max_counter
))
||
"
$(
curl
--silent
--connect-timeout
1
--head
$SERVER_URL
|
grep
"Coyote"
)
"
!=
""
]]
;
do
printf
"."
counter+
=
1
sleep
5
done
total_time
=
counter
*
5
if
[[
((
counter
-ge
max_counter
))
]]
;
then
printf
"
\n
Server failed to start in
$total_time
seconds!
\n
"
exit
1
;
fi
printf
"
\n
Server started in
$total_time
seconds!
\n
"
exit
0
;
apollo-configservice/src/main/scripts/common_startup.sh
deleted
100644 → 0
View file @
7c2c539d
#!/bin/bash
if
[[
-z
"
$JAVA_HOME
"
&&
-d
/usr/java/latest/
]]
;
then
export
JAVA_HOME
=
/usr/java/latest/
fi
cd
`
dirname
$0
`
/..
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
if
[[
!
-f
PATH_TO_JAR
&&
-d
current
]]
;
then
cd
current
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
fi
if
[[
-f
$SERVICE_NAME
".jar"
]]
;
then
rm
-rf
$SERVICE_NAME
".jar"
fi
ln
$PATH_TO_JAR
$SERVICE_NAME
".jar"
chmod
a+x
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
declare
-i
counter
=
0
declare
-i
max_counter
=
30
# 30*5=150s
declare
-i
total_time
=
0
printf
"Waiting for server startup"
until
[[
((
counter
-ge
max_counter
))
||
"
$(
curl
--silent
--connect-timeout
1
--head
$SERVER_URL
|
grep
"Coyote"
)
"
!=
""
]]
;
do
printf
"."
counter+
=
1
sleep
5
done
total_time
=
counter
*
5
if
[[
((
counter
-ge
max_counter
))
]]
;
then
printf
"
\n
Server failed to start in
$total_time
seconds!
\n
"
exit
1
;
fi
printf
"
\n
Server started in
$total_time
seconds!
\n
"
exit
0
;
apollo-configservice/src/main/scripts/startup.sh
View file @
36cdfda0
...
...
@@ -8,4 +8,70 @@ export JAVA_OPTS="$JAVA_OPTS -Xloggc:/opt/logs/100003171/heap_trace.txt -XX:Heap
SERVER_PORT
=
8080
SERVER_URL
=
"http://localhost:
$SERVER_PORT
"
source
./common_startup.sh
########### The following is the same for configservice, adminservice, portal ###########
if
[[
-z
"
$JAVA_HOME
"
&&
-d
/usr/java/latest/
]]
;
then
export
JAVA_HOME
=
/usr/java/latest/
fi
cd
`
dirname
$0
`
/..
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
if
[[
!
-f
PATH_TO_JAR
&&
-d
current
]]
;
then
cd
current
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
fi
if
[[
-f
$SERVICE_NAME
".jar"
]]
;
then
rm
-rf
$SERVICE_NAME
".jar"
fi
ln
$PATH_TO_JAR
$SERVICE_NAME
".jar"
chmod
a+x
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
declare
-i
counter
=
0
declare
-i
max_counter
=
30
# 30*5=150s
declare
-i
total_time
=
0
printf
"Waiting for server startup"
until
[[
((
counter
-ge
max_counter
))
||
"
$(
curl
--silent
--connect-timeout
1
--head
$SERVER_URL
|
grep
"Coyote"
)
"
!=
""
]]
;
do
printf
"."
counter+
=
1
sleep
5
done
total_time
=
counter
*
5
if
[[
((
counter
-ge
max_counter
))
]]
;
then
printf
"
\n
Server failed to start in
$total_time
seconds!
\n
"
exit
1
;
fi
printf
"
\n
Server started in
$total_time
seconds!
\n
"
exit
0
;
apollo-portal/src/main/scripts/common_startup.sh
deleted
100644 → 0
View file @
7c2c539d
#!/bin/bash
if
[[
-z
"
$JAVA_HOME
"
&&
-d
/usr/java/latest/
]]
;
then
export
JAVA_HOME
=
/usr/java/latest/
fi
cd
`
dirname
$0
`
/..
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
if
[[
!
-f
PATH_TO_JAR
&&
-d
current
]]
;
then
cd
current
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
fi
if
[[
-f
$SERVICE_NAME
".jar"
]]
;
then
rm
-rf
$SERVICE_NAME
".jar"
fi
ln
$PATH_TO_JAR
$SERVICE_NAME
".jar"
chmod
a+x
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
declare
-i
counter
=
0
declare
-i
max_counter
=
30
# 30*5=150s
declare
-i
total_time
=
0
printf
"Waiting for server startup"
until
[[
((
counter
-ge
max_counter
))
||
"
$(
curl
--silent
--connect-timeout
1
--head
$SERVER_URL
|
grep
"Coyote"
)
"
!=
""
]]
;
do
printf
"."
counter+
=
1
sleep
5
done
total_time
=
counter
*
5
if
[[
((
counter
-ge
max_counter
))
]]
;
then
printf
"
\n
Server failed to start in
$total_time
seconds!
\n
"
exit
1
;
fi
printf
"
\n
Server started in
$total_time
seconds!
\n
"
exit
0
;
apollo-portal/src/main/scripts/startup.sh
View file @
36cdfda0
...
...
@@ -8,4 +8,70 @@ export JAVA_OPTS="$JAVA_OPTS -Xloggc:/opt/logs/100003173/heap_trace.txt -XX:Heap
SERVER_PORT
=
8080
SERVER_URL
=
"http://localhost:
$SERVER_PORT
"
source
./common_startup.sh
########### The following is the same for configservice, adminservice, portal ###########
if
[[
-z
"
$JAVA_HOME
"
&&
-d
/usr/java/latest/
]]
;
then
export
JAVA_HOME
=
/usr/java/latest/
fi
cd
`
dirname
$0
`
/..
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
if
[[
!
-f
PATH_TO_JAR
&&
-d
current
]]
;
then
cd
current
for
i
in
`
ls
$SERVICE_NAME
-
*
.jar 2>/dev/null
`
do
if
[[
!
$i
==
*
"-sources.jar"
]]
then
PATH_TO_JAR
=
$i
break
fi
done
fi
if
[[
-f
$SERVICE_NAME
".jar"
]]
;
then
rm
-rf
$SERVICE_NAME
".jar"
fi
ln
$PATH_TO_JAR
$SERVICE_NAME
".jar"
chmod
a+x
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
declare
-i
counter
=
0
declare
-i
max_counter
=
30
# 30*5=150s
declare
-i
total_time
=
0
printf
"Waiting for server startup"
until
[[
((
counter
-ge
max_counter
))
||
"
$(
curl
--silent
--connect-timeout
1
--head
$SERVER_URL
|
grep
"Coyote"
)
"
!=
""
]]
;
do
printf
"."
counter+
=
1
sleep
5
done
total_time
=
counter
*
5
if
[[
((
counter
-ge
max_counter
))
]]
;
then
printf
"
\n
Server failed to start in
$total_time
seconds!
\n
"
exit
1
;
fi
printf
"
\n
Server started in
$total_time
seconds!
\n
"
exit
0
;
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