Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-docker-entrypoints
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qg-docker-entrypoints
Commits
c5ce8ff4
Commit
c5ce8ff4
authored
Jul 31, 2019
by
智勇
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
b18b1a8d
70a37f29
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
176 additions
and
5 deletions
+176
-5
run.sh
dev/java/run.sh
+2
-2
java.sh
tke/java.sh
+74
-0
nodejs.sh
tke/nodejs.sh
+31
-0
python.sh
tke/python.sh
+44
-0
ui.sh
tke/ui.sh
+25
-3
No files found.
dev/java/run.sh
View file @
c5ce8ff4
...
...
@@ -125,8 +125,8 @@ else
#sed -i "s#.quantgroup.cn#-$NAMESPACE.liangkebang.com#g" ${config_path}
sed
-i
"s#xterm.js demo#
${
SYSTEM_NAME
}
@
${
NAMESPACE
}
#"
/home/qg-xterm/demo/index.html
echo
"java -Xmx
2048
m -Xloggc:/tmp/
${
module_name
}
_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Denv=dev -Didc=k8s -Dtest=true -jar
${
package_path
}
--worker 1 --currentWorker 1 -t --server.port=80 --spring.config.location=
${
config_path
}
& "
>
java_command
nohup
java
-Xmx
2048
m
-Xloggc
:/tmp/
${
module_name
}
_gc.log
-XX
:+PrintGCDetails
-XX
:+PrintGCTimeStamps
-agentlib
:jdwp
=
transport
=
dt_socket,server
=
y,suspend
=
n,address
=
5005
-Denv
=
dev
-Didc
=
k8s
-Dtest
=
true
-jar
${
package_path
}
--worker
1
--currentWorker
1
-t
--server
.port
=
80
--spring
.config.location
=
${
config_path
}
>
/dev/null 2>&1 &
echo
"java -Xmx
1024
m -Xloggc:/tmp/
${
module_name
}
_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Denv=dev -Didc=k8s -Dtest=true -jar
${
package_path
}
--worker 1 --currentWorker 1 -t --server.port=80 --spring.config.location=
${
config_path
}
& "
>
java_command
nohup
java
-Xmx
1024
m
-Xloggc
:/tmp/
${
module_name
}
_gc.log
-XX
:+PrintGCDetails
-XX
:+PrintGCTimeStamps
-agentlib
:jdwp
=
transport
=
dt_socket,server
=
y,suspend
=
n,address
=
5005
-Denv
=
dev
-Didc
=
k8s
-Dtest
=
true
-jar
${
package_path
}
--worker
1
--currentWorker
1
-t
--server
.port
=
80
--spring
.config.location
=
${
config_path
}
>
/dev/null 2>&1 &
# # waiting for log
# count=0
...
...
tke/java.sh
0 → 100644
View file @
c5ce8ff4
#!/bin/bash
echo
"start run java"
current
=
"/home/quant_group"
echo
"current:
${
current
}
"
echo
"NAMESPACE is
$NAMESPACE
"
module_name
=
project
module_path
=
"
${
current
}
/
${
module_name
}
"
package_path
=
"
${
module_path
}
/app.jar"
config_path
=
"
${
module_path
}
/application.properties"
log_path
=
"/home/quant_group/logs"
rm
-rf
${
log_path
}
/
*
echo
192.168.4.50 eos.quantgroups.com
>>
/etc/hosts
echo
172.17.1.7 apollo-dev.quantgroups.com
>>
/etc/hosts
echo
172.20.3.11 sentry.quantgroups.com
>>
/etc/hosts
# echo 172.30.3.206 apollo-dev.quantgroups.com >> /etc/hosts
# echo 172.20.3.11 sentry.quantgroups.com >> /etc/hosts
# echo 192.168.4.3 sonar.quantgroups.com >> /etc/hosts
# echo 192.168.4.117 yapi.quantgroups.com >> /etc/hosts
echo
"sed domain from xyqb.com to liangkebang.net"
sed
-i
"s#.xyqb.com#-
$NAMESPACE
.liangkebang.net#g"
${
config_path
}
sed
-i
"s#.domain.com#-
$NAMESPACE
.liangkebang.net#g"
${
config_path
}
# sed -i "s#.quantgroup.cn#-$NAMESPACE.liangkebang.net#g" ${config_path}
# sed -i "s#xterm.js demo#${SYSTEM_NAME}@${NAMESPACE}#" /home/qg-xterm/demo/index.html
namespace
=
"
$NAMESPACE
"
echo
"namespace is
$namespace
"
echo
"unset NAMESPACE"
>>
~/.bashrc
echo
"alias log='cd logs;tail -500f *log';"
>>
~/.bashrc
source
~/.bashrc
# source ~/.bash_profile
basicCmd
=
"java -Xmx512m -XX:CompressedClassSpaceSize=128m -Xloggc:/tmp/
${
module_name
}
_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dtest=true"
debugCmd
=
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
apolloCmd
=
"-Denv=dev -Didc=k8s -DNAMESPACE=
${
namespace
}
-Dapollo.longPollingInitialDelayInMills=200000"
apolloMockCmd
=
"-Denv=dev -Didc=k8s-mock -DNAMESPACE=
${
namespace
}
-Dapollo.longPollingInitialDelayInMills=200000"
# -jar选项需要在调试和apollo选项后面
jarCmd
=
"-jar
${
package_path
}
--worker 1 --currentWorker 1 -t --server.port=80"
logCmd
=
"-Dlogging.config=classpath:logback-dev.xml"
finalCmd
=
""
if
[[
$SYSTEM_NAME
==
'gu-bei'
||
$SYSTEM_NAME
==
'clotho'
]]
;
then
if
[[
$MOCK
==
1
]]
;
then
finalCmd
=
"
$basicCmd
$debugCmd
$apolloMockCmd
$jarCmd
--spring.config.location=
${
config_path
}
"
else
finalCmd
=
"
$basicCmd
$debugCmd
$apolloCmd
$jarCmd
--spring.config.location=
${
config_path
}
"
fi
elif
[[
$SYSTEM_NAME
==
'pcm'
||
$SYSTEM_NAME
==
'acs-batch'
||
$SYSTEM_NAME
==
'acs-quartz'
||
$SYSTEM_NAME
==
'acs-service'
||
$SYSTEM_NAME
==
'acs-web'
||
$SYSTEM_NAME
==
'app-server'
||
$SYSTEM_NAME
==
'smart-recruitment'
]]
;
then
# 不能指定config.location
finalCmd
=
"
$basicCmd
$debugCmd
$apolloCmd
$jarCmd
"
elif
[[
$SYSTEM_NAME
==
'xyqb-mall'
]]
;
then
# xyqb-mall打印调试信息
finalCmd
=
"
$basicCmd
$debugCmd
$logCmd
$apolloCmd
$jarCmd
--spring.config.location=
${
config_path
}
"
else
finalCmd
=
"
$basicCmd
$debugCmd
$apolloCmd
$jarCmd
--spring.config.location=
${
config_path
}
"
fi
echo
"
$finalCmd
"
>
java_command
if
[[
$DEBUG
==
1
]]
;
then
echo
'debug'
nohup
$finalCmd
&
tail
-f
~/.bashrc
else
nohup
$finalCmd
fi
echo
done
!
\ No newline at end of file
tke/nodejs.sh
0 → 100644
View file @
c5ce8ff4
#!/bin/sh
echo
"start run nodejs"
package_path
=
"/home/quant_group"
echo
"NAMESPACE is
$NAMESPACE
"
echo
"cd
${
package_path
}
"
cd
${
package_path
}
echo
"echo host"
echo
192.168.4.50 eos.quantgroups.com
>>
/etc/hosts
echo
172.17.1.7 apollo-dev.quantgroups.com
>>
/etc/hosts
# echo 172.20.3.11 sentry.quantgroups.com >> /etc/hosts
echo
"tar zxf dist.tgz -C
${
package_path
}
"
tar
zxf
${
package_path
}
/dist.tgz
-C
${
package_path
}
/
echo
"rm -rf
${
package_path
}
/dist.tgz"
rm
-rf
${
package_path
}
/dist.tgz
echo
"start"
# curl -s "http://172.30.220.22:3003/proconfig/get_info?system_name=${SYSTEM_NAME}&key=start_command" | sh
# tail -f /var/log/*.log
node ./bin/server.js
if
[[
$DEBUG
==
1
]]
;
then
echo
'debug'
tail
-f
~/.bashrc
fi
echo
done
!!!
\ No newline at end of file
tke/python.sh
0 → 100755
View file @
c5ce8ff4
#!/bin/sh
echo
"start run python"
package_path
=
"/home/quant_group"
echo
"NAMESPACE is
$NAMESPACE
"
echo
"cd
${
package_path
}
"
cd
${
package_path
}
echo
"echo host"
echo
172.30.3.209 http://opapi.xyqb.com
>>
/etc/hosts
echo
"tar zxf dist.tgz -C
${
package_path
}
"
tar
zxf
${
package_path
}
/dist.tgz
-C
${
package_path
}
/
echo
"rm -rf
${
package_path
}
/dist.tgz"
rm
-rf
${
package_path
}
/dist.tgz
#echo "prepare ~/.pip/pip.conf"
#mkdir -p ~/.pip/
#touch ~/.pip/pip.conf
#echo "[global]" >> ~/.pip/pip.conf
#echo "index-url=https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.pip/pip.conf
#echo "[install]" >> ~/.pip/pip.conf
#echo "trusted-host=mirrors.aliyun.com" >> ~/.pip/pip.conf
#
#echo "pip intall requirements"
#pip install -r ${package_path}/requirements.txt
echo
"sed domain.com to liangkebang.com"
find
${
package_path
}
/
-type
f
-name
"*.conf"
| xargs
sed
-i
"s#
\.
domain
\.
com#-
$NAMESPACE
.liangkebang.com#g"
find
${
package_path
}
/
-type
f
-name
"*.conf"
| xargs
sed
-i
"s#
\.
xyqb
\.
com#-
$NAMESPACE
.liangkebang.com#g"
echo
"sed port from 8999 to 80"
find
${
package_path
}
/
-type
f
-name
"*.py"
| xargs
sed
-i
"s#8999#80#g"
echo
"start python"
python ./startup.py
tail
-f
~/.bashrc
#if [[ $DEBUG == 1 ]]; then
# echo 'debug'
# tail -f ~/.bashrc
#fi
echo
done
!!!
tke/ui.sh
View file @
c5ce8ff4
...
...
@@ -4,15 +4,37 @@ echo "start run ui"
current
=
"/home/quant_group"
echo
"current:
${
current
}
"
export
NAMESPACE
=
`
cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace
`
echo
"NAMESPACE is
$NAMESPACE
"
# 运行qa工具
echo
"SYSTEM_NAME is
$SYSTEM_NAME
"
host
=
`
curl
-s
http://172.30.220.22:3003/proconfig/get_host?system_name
=
${
SYSTEM_NAME
}
`
host
=
`
curl
-s
-m
5
"http://qaapi.liangkebang.com/proconfig/get_info?system_name=
${
SYSTEM_NAME
}
&key=host_name"
`
echo
"host:
${
host
}
"
if
[[
"
$host
"
==
""
||
"
$host
"
=
~
'0001'
]]
;
then
echo
"获取host异常,请检查 http://qaapi.liangkebang.com/proconfig/get_info?system_name=
${
SYSTEM_NAME
}
&key=host_name"
exit
-1
fi
for
entry
in
./
*
tgz
do
with_ext
=
$(
basename
"
$entry
"
)
echo
${
with_ext
}
fname
=
"
${
with_ext
%.*
}
"
echo
"mkdir -p
${
current
}
/
$fname
"
mkdir
-p
${
current
}
/
$fname
echo
"tar zxf
${
current
}
/
$with_ext
-C
${
current
}
/
$fname
"
tar
zxf
${
current
}
/
$with_ext
-C
${
current
}
/
$fname
# echo "rm -rf ${package_path}/$with_ext"
# rm -rf ${package_path}/$with_ext
done
curl
-sSL
http://git.q
-gp.com
/QA/config_repository/raw/master/yaml/replace.py
-o
replace.py
curl
-sSL
http://git.q
-gp.com/QA/config_repository/raw/master/yaml/replace_config
.yaml
-o
replace_config.yaml
curl
-sSL
http://git.q
uantgroup.cn
/QA/config_repository/raw/master/yaml/replace.py
-o
replace.py
curl
-sSL
http://git.q
uantgroup.cn/QA/config_repository/raw/master/yaml/replace_config_tke
.yaml
-o
replace_config.yaml
python replace.py
$host
;
echo
"/usr/bin/openresty -g 'daemon off;'"
...
...
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