From 8f0107b46cb350966cf6ab668ff00b864ff0d8f7 Mon Sep 17 00:00:00 2001 From: fxiang21 Date: Thu, 23 Nov 2023 16:03:56 +0800 Subject: [PATCH] doc: add install.sh method in readme --- README.md | 23 +++++++++++++++++------ docs/README_en.md | 29 +++++++++++++++++++++++++---- install.sh | 5 ++++- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e752805..cf3c635 100644 --- a/README.md +++ b/README.md @@ -73,20 +73,31 @@ ## 安装 ### Docker 一键快速构建 -- 进入主目录(先安装 docker 环境, 注意要clone整个项目) - +> 方法一 +- 第一步: 拷贝项目 +```shell +git clone https://github.com/veops/cmdb.git +``` +- 第二步:进入主目录(先安装 docker 环境, 以及docker-compose) ``` docker-compose up -d ``` - -- 浏览器打开: [http://127.0.0.1:8000](http://127.0.0.1:8000) -- username: demo 或者 admin -- password: 123456 +> 方法二, 该方法适用于linux系统 +```shell +curl -ssL https://raw.githubusercontent.com/veops/cmdb/dev_install/install.sh -o install.sh +sh istall.sh install +``` ### [本地开发环境搭建](docs/local.md) ### [Makefile 安装](docs/makefile.md) +## 验证 +- 浏览器打开: [http://127.0.0.1:8000](http://127.0.0.1:8000) +- username: demo 或者 admin +- password: 123456 + + --- _**欢迎关注公众号(维易科技OneOps),关注后可加入微信群,进行产品和技术交流。**_ diff --git a/docs/README_en.md b/docs/README_en.md index 57e7b5e..b100fbc 100644 --- a/docs/README_en.md +++ b/docs/README_en.md @@ -68,20 +68,41 @@ ### One-Click Docker Quick Build -- Prepare: install docker and docker-compose +> Method 1 +- step 1: **Prepare: install docker and docker-compose** +- step 2: copy the repository +```shell +git clone https://github.com/veops/cmdb.git +``` +- step 3: In directory cmdb: +``` +docker-compose up -d +``` +> Method 2 +- step 1: **Prepare: install docker and docker-compose** +- step 2: +```shell +curl -ssL https://raw.githubusercontent.com/veops/cmdb/master/install.sh -o install.sh +sh istall.sh install +``` + - In directory cmdb ``` docker-compose up -d ``` -- View: [http://127.0.0.1:8000](http://127.0.0.1:8000) -- username: demo or admin -- password: 123456 + ### [Local Setup](local_en.md) ### [Installation with Makefile](makefile_en.md) +## Validation + +- View: [http://127.0.0.1:8000](http://127.0.0.1:8000) +- username: demo or admin +- password: 123456 + ## Contributing 1. Fork it diff --git a/install.sh b/install.sh index eae65bd..ab3e3f9 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -cmdb_dir="/home/$(whoami)/apps" +cmdb_dir="~/apps" check_docker() { if [ -x "$(command -v docker)" ]; then @@ -129,6 +129,9 @@ uninstall_service() { current_path=$(pwd) cd ${cmdb_dir}/cmdb || exit 1 docker-compose down -v + if [ $? -eq 0 ];then + rm -fr ${cmdb_dir}/cmdb + fi cd $current_path || exit 1 fi }