From b61cdabd466a5ca1da3ff293e81b9a978c29d2ed Mon Sep 17 00:00:00 2001 From: ubuntu <ubuntu@ubuntu.com> Date: Fri, 27 Jul 2018 12:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=AE=89=E8=A3=85=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=AB=AF=E5=92=8C=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autodeploy/Dockerfile | 18 ++++++++++++++++++ autodeploy/config.json | 37 +++++++++++++++++++++++++++++++++++++ autodeploy/readme | 9 +++++++++ 3 files changed, 64 insertions(+) create mode 100755 autodeploy/Dockerfile create mode 100755 autodeploy/config.json create mode 100755 autodeploy/readme diff --git a/autodeploy/Dockerfile b/autodeploy/Dockerfile new file mode 100755 index 0000000..a4bafd4 --- /dev/null +++ b/autodeploy/Dockerfile @@ -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' diff --git a/autodeploy/config.json b/autodeploy/config.json new file mode 100755 index 0000000..5e82392 --- /dev/null +++ b/autodeploy/config.json @@ -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" + } + ] +} diff --git a/autodeploy/readme b/autodeploy/readme new file mode 100755 index 0000000..720f669 --- /dev/null +++ b/autodeploy/readme @@ -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 &