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 &