step
- Put the source into the D drive (source is a separate git library)
- Put the D disk on the website (the hexo project folder)
- The source under the website directory pulls from the remote warehouse of 1 every time
- The source under the website deletes files whose title starts with [unfinished] after each pull
- cd to website hexo generate generate public folder under website
- cd to the public folder, push the entire folder to the github page project
- carry out!
Local sh
#!/bin/bash
cd d:
SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
echo "current dir is ================>$SHELL_FOLDER"
cd source
time=$(date "+%Y-%m-%d %H:%M:%S")
echo $time
git status
git add .
git commit -m "modify ${time}"
git push
cd ..
SHELL_FOLDER2=$(cd "$(dirname "$0")";pwd)
echo "current dir is ================>$SHELL_FOLDER2"
cd website/source
SHELL_FOLDER3=$(cd "$(dirname "$0")";pwd)
echo "current dir is ================>$SHELL_FOLDER3"
git pull
find . -name "【未完】*" -exec rm -f {} \;
cd ..
hexo generate
cd public
SHELL_FOLDER4=$(cd "$(dirname "$0")";pwd)
echo "current dir is ================>$SHELL_FOLDER4"
git add .
git commit -m "modify ${time}"
git push
echo "Done!!!!!!"
Configure Jenkins