mirror of
https://github.com/yeasy/docker_practice.git
synced 2024-11-24 07:23:38 +00:00
Add shell script for offline read
This commit is contained in:
parent
c5c8b7d20a
commit
dddfcf2832
20
bin/offline
Executable file
20
bin/offline
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f offline ];then echo "请在项目根目录执行 $0"; exit 1; fi
|
||||
|
||||
command -v docker-compose > /dev/null 2>&1
|
||||
|
||||
if [ $? != 0 ];then echo "请安装 docker-compose"; exit 1; fi
|
||||
|
||||
if [ "$1" = update ];then
|
||||
status=`git status -s`
|
||||
if [ -z "$status" ];then
|
||||
git fetch --depth=1 origin master
|
||||
git reset --hard origin/master
|
||||
else
|
||||
echo "您已修改项目,请提交或恢复原状!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
docker-compose up server
|
Loading…
Reference in New Issue
Block a user