一键安装服务端和客户端

This commit is contained in:
ubuntu 2018-07-27 12:12:00 +08:00
parent f2c63aa607
commit b61cdabd46
3 changed files with 64 additions and 0 deletions

18
autodeploy/Dockerfile Executable file

@ -0,0 +1,18 @@
FROM nginx
MAINTAINER cppla https://cpp.la
RUN apt-get update
RUN apt-get -y install gcc g++ make git
RUN git clone https://github.com/cppla/ServerStatus
RUN cp -rf /ServerStatus/web/* /usr/share/nginx/html/
WORKDIR /ServerStatus/server
RUN make
RUN pwd && ls -a
EXPOSE 80 35601
CMD nohup sh -c '/etc/init.d/nginx start && /ServerStatus/server/sergate --config=/ServerStatus/server/config.json --web-dir=/usr/share/nginx/html'

37
autodeploy/config.json Executable file

@ -0,0 +1,37 @@
{"servers":
[
{
"username": "s01",
"name": "node1",
"type": "xen",
"host": "host1",
"location": "cn",
"password": "USER_DEFAULT_PASSWORD"
},
{
"username": "s02",
"name": "node2",
"type": "vmware",
"host": "host2",
"location": "jp",
"password": "USER_DEFAULT_PASSWORD"
},
{
"disabled": true,
"username": "s03",
"name": "node3",
"type": "Nothing",
"host": "host3",
"location": "fr",
"password": "USER_DEFAULT_PASSWORD"
},
{
"username": "s04",
"name": "ssss",
"type": "ssss",
"host": "ssss",
"location": "ssss",
"password": "USER_DEFAULT_PASSWORD"
}
]
}

9
autodeploy/readme Executable file

@ -0,0 +1,9 @@
服务端:
curl -sSL https://get.docker.com/ | sh #一键安装docker
docker build -f Dockerfile-server -t sss .
docker run -d --restart=always --name=sss -v {$path}/config.json:/ServerStatus/server/config.json -p {$port}:80 -p {$port}:35601 sss
客户端:
wget --no-check-certificate -qO client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py' && nohup python client-linux.py SERVER={$SERVER} USER={$USER} >/dev/null 2>&1 &