Local automated deployment website

step

  1. Put the source into the D drive (source is a separate git library)
  2. Put the D disk on the website (the hexo project folder)
  3. The source under the website directory pulls from the remote warehouse of 1 every time
  4. The source under the website deletes files whose title starts with [unfinished] after each pull
  5. cd to website hexo generate generate public folder under website
  6. cd to the public folder, push the entire folder to the github page project
  7. 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

Guess you like

Origin www.cnblogs.com/for-you/p/12761903.html