Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
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-dockerfiles
Commits
dfd8df38
Commit
dfd8df38
authored
Apr 16, 2018
by
wentao.suo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.quantgroup.cn/QA/qg-dockerfiles
parents
63f102df
6f5f17c4
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
230 deletions
+9
-230
my.cnf
baseimg/tools/db/my.cnf
+3
-1
Dockerfile
templates/java/Dockerfile
+0
-1
docker-entrypoint.sh
templates/java/docker-entrypoint.sh
+2
-87
server.properties
templates/java/server.properties
+0
-2
docker-entrypoint.sh
templates/lua-ui/docker-entrypoint.sh
+1
-57
docker-entrypoint.sh
templates/nodejs/docker-entrypoint.sh
+1
-45
docker-entrypoint.sh
templates/python/docker-entrypoint.sh
+1
-18
docker-entrypoint.sh
templates/tools/eos/docker-entrypoint.sh
+1
-19
No files found.
baseimg/tools/db/my.cnf
View file @
dfd8df38
...
...
@@ -28,3 +28,5 @@ log-error = /var/log/mysql/error.log
symbolic-links=0
max_connections = 1000
log-bin=/var/lib/mysql/mysql-bin
\ No newline at end of file
templates/java/Dockerfile
View file @
dfd8df38
...
...
@@ -13,7 +13,6 @@ RUN echo -e "${BUILD_SCHEMA//@/\n}" >> ./build_info
COPY
docker-entrypoint.sh .
COPY
./*.jar /home/quant_group/project/app.jar
COPY
./application.properties /home/quant_group/project/application.properties
# COPY ./server.properties /opt/settings/
RUN
chmod
+x ./docker-entrypoint.sh
CMD
./docker-entrypoint.sh
\ No newline at end of file
templates/java/docker-entrypoint.sh
View file @
dfd8df38
#!/bin/bash
echo
"java_start java"
module_name
=
project
package_path
=
"
`
pwd
`
/
${
module_name
}
/app.jar"
config_path
=
"
`
pwd
`
/
${
module_name
}
/application.properties"
export
NAMESPACE
=
`
cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace
`
echo
"NAMESPACE is
$NAMESPACE
"
echo
172.30.5.214 ldap.quantgroups.com
>>
/etc/hosts
echo
192.168.6.13 eos.quantgroups.com
>>
/etc/hosts
echo
192.168.4.117 apollo-dev.quantgroups.com
>>
/etc/hosts
source
~/.bash_profile
sed
-i
"s#.xyqb.com#-
$NAMESPACE
.q-gp.com#g"
${
config_path
}
sed
-i
"s#.domain.com#-
$NAMESPACE
.q-gp.com#g"
${
config_path
}
sed
-i
"s#.quantgroup.cn#-
$NAMESPACE
.q-gp.com#g"
${
config_path
}
sed
-i
"s#xterm.js demo#
${
SYSTEM_NAME
}
@
${
NAMESPACE
}
#"
/home/qg-xterm/demo/index.html
if
[[
$CLUSTER
==
"3B"
]]
;
then
echo
"java -Xmx512m -Xloggc:/tmp/
${
module_name
}
_gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Denv=pro -Didc=k8s3b -jar
${
package_path
}
--worker 1 --currentWorker 1 -t --server.port=80 --spring.config.location=
${
config_path
}
>/dev/null 2>&1"
>
java_command
nohup
java
-Xmx512m
-Xloggc
:/tmp/
${
module_name
}
_gc.log
-XX
:+PrintGCDetails
-XX
:+PrintGCTimeStamps
-Denv
=
pro
-Didc
=
k8s3b
-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
log_exist
=
0
log_path
=
"/home/quant_group/logs"
until
[[
$count
-eq
60
]]
||
[[
$log_exist
-eq
1
]]
do
let
count+
=
1
echo
"count is
$count
"
if
find
"
$log_path
"
-mindepth
1
-print
-quit
|
grep
-q
.
;
then
echo
"log is exist!"
log_exist
=
1
fi
sleep
1
done
if
[[
$count
-eq
60
]]
&&
[[
$log_exist
-eq
0
]]
;
then
touch
./logs/error.log
echo
"Log is not exist or java server start error."
>>
./logs/error.log
fi
echo
"tail -f ./logs/*log"
tail
-f
./logs/
*
log
else
echo
"java -Xmx512m -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
-Xmx512m
-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
log_exist
=
0
log_path
=
"/home/quant_group/logs"
until
[[
$count
-eq
60
]]
||
[[
$log_exist
-eq
1
]]
do
let
count+
=
1
echo
"count is
$count
"
if
find
"
$log_path
"
-mindepth
1
-print
-quit
|
grep
-q
.
;
then
echo
"log is exist!"
log_exist
=
1
fi
sleep
1
done
if
[[
$count
-eq
60
]]
&&
[[
$log_exist
-eq
0
]]
;
then
touch
./logs/error.log
echo
"Log is not exist or java server start error."
>>
./logs/error.log
fi
echo
"cd /home/qg-xterm/;git pull;cd -"
cd
/home/qg-xterm/
;
git pull
;
cd
-
echo
"node /home/qg-xterm/demo/app.js"
nohup
node /home/qg-xterm/demo/app.js &
echo
"frontail ./logs/*log -n 500 -d "
frontail ./logs/
*
log
-n
500
-d
echo
"tail -f ./logs/*log"
tail
-f
./logs/
*
log
fi
\ No newline at end of file
#!/bin/sh
curl
-sSL
http://192.168.3.60/QA/qg-docker-entrypoints/raw/master/dev/java/run.sh | sh
\ No newline at end of file
templates/java/server.properties
deleted
100644 → 0
View file @
63f102df
env
=
dev
idc
=
k8s
\ No newline at end of file
templates/lua-ui/docker-entrypoint.sh
View file @
dfd8df38
#!/bin/sh
echo
"deploy openresty"
package_path
=
"/home/quant_group"
echo
"cd
${
package_path
}
"
cd
${
package_path
}
export
NAMESPACE
=
`
cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace
`
echo
"NAMESPACE is
$NAMESPACE
"
for
entry
in
./
*
tgz
do
with_ext
=
$(
basename
"
$entry
"
)
fname
=
"
${
with_ext
%.*
}
"
echo
"mkdir -p /home/quant_group/
$fname
"
mkdir
-p
/home/quant_group/
$fname
echo
"tar zxf
${
package_path
}
/
$with_ext
-C
${
package_path
}
/
$fname
"
tar
zxf
${
package_path
}
/
$with_ext
-C
${
package_path
}
/
$fname
echo
"rm -rf
${
package_path
}
/
$with_ext
"
rm
-rf
${
package_path
}
/
$with_ext
done
echo
"cd /home/qg-xterm/;git pull;cd -"
cd
/home/qg-xterm/
;
git pull
;
cd
-
source
~/.bash_profile
echo
"sed xyqb.com to q-gp.com"
# find ${package_path}/ -name "*.js" | xargs sed -i "s/.xyqb.com/-$NAMESPACE.q-gp.com/g"
find
${
package_path
}
/
-name
"*.js"
| xargs
sed
-i
"s#.domain.com#-
$NAMESPACE
.q-gp.com#g"
sed
-i
"s/xterm.js demo/
${
SYSTEM_NAME
}
@
${
NAMESPACE
}
/"
/home/qg-xterm/demo/index.html
default_conf_file
=
"/usr/local/openresty/nginx/conf/conf.d/default.vh.conf"
if
[
-f
"
$default_conf_file
"
]
then
sed
-i
"s/SYSTEM_NAME/
${
SYSTEM_NAME
}
/"
$default_conf_file
fi
echo
"mkdir -p /var/log/nginx"
mkdir
-p
/var/log/nginx
echo
"touch /var/log/nginx/error.log"
touch
/var/log/nginx/error.log
echo
"touch /var/log/nginx/access.log"
touch
/var/log/nginx/access.log
echo
"/usr/bin/openresty -g 'daemon off;'"
nohup
/usr/bin/openresty
-g
'daemon off;'
&
echo
"node /home/qg-xterm/demo/app.js"
nohup
node /home/qg-xterm/demo/app.js &
echo
"frontail logs/*.log -d -n 1000"
frontail /var/log/nginx/
*
log
-n
1000
\ No newline at end of file
curl
-sSL
http://192.168.3.60/QA/qg-docker-entrypoints/raw/master/dev/lua-ui/run.sh | sh
\ No newline at end of file
templates/nodejs/docker-entrypoint.sh
View file @
dfd8df38
#!/bin/sh
echo
"deploy node"
package_path
=
"/home/quant_group/project"
echo
"cd
${
package_path
}
"
cd
${
package_path
}
echo
"tar zxf dist.tgz -C
${
package_path
}
"
tar
zxf
${
package_path
}
/dist.tgz
-C
${
package_path
}
/
echo
"sed sed xyqb.com to q-gp.com"
namespace
=
`
cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace
`
echo
"namespace is
$namespace
"
echo
172.30.5.214 ldap.quantgroups.com
>>
/etc/hosts
# find ${package_path}/ -type f -name "*.js" | xargs sed -i "s/.xyqb.com/-$namespace.q-gp.com/g"
find
${
package_path
}
/
-type
f
-name
"*.js"
| xargs
sed
-i
"s#.domain.com#-
$namespace
.q-gp.com#g"
sed
-i
"s#xterm.js demo#
${
SYSTEM_NAME
}
@
${
namespace
}
#"
/home/qg-xterm/demo/index.html
echo
"rm dist.tgz public/dist -rf"
rm
-rf
${
package_path
}
/dist.tgz
source
~/.bash_profile
echo
"sh start.sh"
sh start.sh
echo
"sleep 3"
sleep
3
if
ls
./
*
log 1> /dev/null 2>&1
;
then
echo
"ls -l ./logs"
ls
-l
./logs
else
echo
"files do not exist"
touch
./logs/tmp.log
fi
echo
"cd /home/qg-xterm/;git pull;cd -"
cd
/home/qg-xterm/
;
git pull
;
cd
-
echo
"node /home/qg-xterm/demo/app.js"
nohup
node /home/qg-xterm/demo/app.js &
echo
"frontail logs/*.log -d -n 1000"
frontail ./logs/
*
log
-n
1000
\ No newline at end of file
curl
-sSL
http://192.168.3.60/QA/qg-docker-entrypoints/raw/master/dev/nodejs/run.sh | sh
\ No newline at end of file
templates/python/docker-entrypoint.sh
View file @
dfd8df38
#!/bin/sh
echo
"deploy xyqp-query"
package_path
=
"/home/quant_group/project"
echo
"cd
${
package_path
}
"
cd
${
package_path
}
source
~/.bash_profile
echo
172.30.5.214 ldap.quantgroups.com
>>
/etc/hosts
echo
"tar zxf dist.tgz -C
${
package_path
}
"
tar
zxf
${
package_path
}
/dist.tgz
-C
${
package_path
}
/
echo
"rm dist.tgz public/dist -rf"
rm
-rf
${
package_path
}
/dist.tgz
echo
"python run.py --mode=beta --port=80"
python
${
package_path
}
/server/run.py
--mode
=
beta
--port
=
80
\ No newline at end of file
curl
-sSL
http://192.168.3.60/QA/qg-docker-entrypoints/raw/master/dev/python/run.sh | sh
\ No newline at end of file
templates/tools/eos/docker-entrypoint.sh
View file @
dfd8df38
#!/bin/sh
echo
"deploy eos"
package_path
=
"/home/quant_group/project"
echo
"cd
${
package_path
}
"
cd
${
package_path
}
echo
"192.168.6.4 kubernetes"
>>
/etc/hosts
echo
"tar zxf
${
package_path
}
/dist.tgz -C
${
package_path
}
"
tar
zxf
${
package_path
}
/dist.tgz
-C
${
package_path
}
/
echo
"rm dist.tgz public/dist -rf"
rm
-rf
${
package_path
}
/dist.tgz
echo
"pip intall requirements"
pip
install
-r
${
package_path
}
/requirements.txt
echo
"python run.py"
python
${
package_path
}
/run.py 3APro
\ No newline at end of file
curl
-sSL
http://192.168.3.60/QA/qg-docker-entrypoints/raw/master/dev/tools/eos/run.sh | sh
\ 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