未验证 提交 3af9f1ea 编写于 作者: C colynn.liu 提交者: GitHub

Merge pull request #45 from sampsonye/feat-quick-start

添加支持一键部署脚本
......@@ -87,6 +87,13 @@ $ yarn run dev
http://your-ip:8081
```
## 一键部署最新版本
1. 准备一台可以正常运行的linux服务器(支持MacOS)
2. 安装Docker 和 Docker Compose
```sh
curl -sSL https://raw.githubusercontent.com/go-atomci/atomci/master/deploy/docker-compose/quick_start.sh | bash
```
## 如何构建镜像
### 前端
......
#!/bin/bash
# Install Latest ATOMCI Release
os=`uname -a`
server_url=""
git_urls=('github.com' 'hub.fastgit.org')
echo '正在检测可用服务器'
for git_url in ${git_urls[*]}
do
success="true"
for i in {1..3}
do
echo -ne "检测 ${git_url} ... ${i} "
curl -m 5 -kIs https://${git_url} >/dev/null
if [ $? != 0 ];then
echo "failed"
success="false"
break
else
echo "ok"
sleep 1s
fi
done
if [ ${success} == "true" ];then
server_url=${git_url}
break
fi
done
if [ "x${server_url}" == "x" ];then
echo "没有找到稳定的下载服务器,请稍候重试"
exit 1
fi
echo "使用下载服务器 ${server_url}"
# 支持MacOS
if [[ $os =~ 'Darwin' ]];then
ATOMCIVERSION=$(curl -s https://${server_url}/go-atomci/atomci/releases/latest |grep -Eo '[0-9]+.[0-9]+.[0-9]+')
else
ATOMCIVERSION=$(curl -s https://${server_url}/go-atomci/atomci/releases/latest/download 2>&1 | grep -Po '[0-9]+\.[0-9]+\.[0-9]+.*(?=")')
fi
echo '当前最新版本为:${ATOMCIVERSION} 开始下载...'
wget --no-check-certificate https://${server_url}/go-atomci/atomci/releases/download/v${ATOMCIVERSION}/atomci-${ATOMCIVERSION}-docker-compose.tgz
tar zxf atomci-${ATOMCIVERSION}-docker-compose.tgz
cd atomci-${ATOMCIVERSION}
echo '开始部署'
docker-compose down && docker-compose up -d
/bin/bash init.sh
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册