Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
refactor: update publish.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
xiamibuchi committed Oct 27, 2020
1 parent 95f59e3 commit f25d02f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
DOCKER_NAME=shen_blog
PROJ_DIR=blog-docker

echo "######## Begin $(date +%Y%m%d_%T) ########"

if [ ! -d "./$PROJ_DIR" ]; then
git clone https://github.com/xiamibuchi/blog.git
fi


echo "######## Begin git clone ########"
cd $PROJ_DIR
git fetch
git pull

echo "######## Begin build dokcer image ########"
docker build -t $DOCKER_NAME .
echo "######## Begin stop old dokcer container ########"
docker stop $DOCKER_NAME
echo "######## Begin delete old dokcer container ########"
docker rm $DOCKER_NAME
echo "######## Begin run dokcer container ########"
docker run --name $DOCKER_NAME -p 2333:80 -d $DOCKER_NAME

0 comments on commit f25d02f

Please sign in to comment.