伪静态 & test.new-realm.cn
webhook & 微信测试开发¶
宝塔面板-网站-子目录绑定-域名,配置伪静态
¶
域名test.new-realm.cn
对应目录/www/wwwroot/new-realm.cn/test
location / {
proxy_pass http://127.0.0.1:5050;
}
test.new-realm.cn
webhook¶
配置文件
#!/bin/bash
echo "Some ('push') event(s) makes webhook start!"
echo "-------------------Start-------------------"
date --date='0 days ago' "+%Y-%m-%d %H:%M:%S"
# PARAM=myflask
PARAM=$1
echo "Use '$PARAM' instead of passing by param '$1'"
if [ ! -n "$PARAM" ];
then
echo "$PARAM is NULL!No param come in!"
echo "--------------------End--------------------"
exit
fi
gitLocal="/www/wwwroot/new-realm.cn/test/$PARAM"
gitRemote="https://github.com/dick7/$PARAM.git"
echo "gitLocal: $gitLocal"
echo "gitRemote: $gitRemote"
if [ -d "$gitLocal" ];
then
echo "$gitLocal EXISTs!"
cd $gitLocal
if [ ! -d ".git" ]; then
echo "$gitLocal dir does NOT contain '.git'!Needs 'git clone ...'"
git clone $gitRemote gittemp
echo "git clone completed!"
echo "mv gittemp/.git ."
mv gittemp/.git .
echo "rm -rf gittemp"
rm -rf gittemp
fi
echo "'git pull ...' from $gitRemote."
#git reset --hard origin/master
git pull
echo "change $gitLocal own rights to 'www:www'"
chown -R www:www $gitLocal
echo "--------------------End--------------------"
exit
else
echo "$gitLocal does NOT EXIST!"
echo "--------------------End--------------------"
exit
fi
其中,主要修改部分:
gitLocal="/www/wwwroot/new-realm.cn/test/$PARAM"
微信测试开发¶
Last update: 2020-03-04 08:42:08