mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-02 22:11:38 +00:00
add travis
This commit is contained in:
29
.travis/deploy.sh
Executable file
29
.travis/deploy.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
git clone -b gh-pages "$REPO" .deploy_git
|
||||
- git ls-files | while read file; do touch -d $(git log -1 --format="@%ct" "$file") "$file"; done
|
||||
if [ ! $? = 0 ];then
|
||||
#不存在
|
||||
echo -e "\033[31mINFO\033[0m BRANCH <gh-pages> NOT exist"
|
||||
mkdir .deploy_git
|
||||
cd .deploy_git
|
||||
git init
|
||||
git remote add origin $REPO
|
||||
git checkout -b gh-pages
|
||||
cd ..
|
||||
else
|
||||
#存在
|
||||
echo -e "\033[32mINFO\033[0m BRANCH exist"
|
||||
rm -rf .deploy_git/*
|
||||
fi
|
||||
# Deploy to GitHub and aliyun
|
||||
cp -r _book/* .deploy_git/
|
||||
cd .deploy_git
|
||||
git add .
|
||||
COMMIT=`date "+%F %T"`
|
||||
TAG=`date '+%s'`
|
||||
git commit -m "Travis CI Site updated: $COMMIT"
|
||||
git push -f origin gh-pages
|
||||
git tag | tail -10
|
||||
git tag
|
||||
git tag $TAG
|
||||
git push origin $TAG
|
BIN
.travis/khs1994-robot.enc
Normal file
BIN
.travis/khs1994-robot.enc
Normal file
Binary file not shown.
Reference in New Issue
Block a user