From 334988c15adfcccc7cfd325ca52b1516df104a97 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Sep 2019 14:20:52 +0800 Subject: [PATCH] * finish task #6335. --- bin/init.bat | 42 +++++++++++++++++++++++++++++++++++++++++- bin/init.sh | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/bin/init.bat b/bin/init.bat index 04f534a605..1595bb2ab0 100644 --- a/bin/init.bat +++ b/bin/init.bat @@ -83,7 +83,7 @@ if %requestType% == 'PATH_INFO' ( echo %syncsvn% > %baseDir%syncsvn.bat echo syncsvn.bat ok -:: create syncgit.bat +:: create syncgit.bat. if %requestType% == 'PATH_INFO' ( SET syncgit= %phpcli% %baseDir%ztcli "%pmsRoot%/git-run" )else ( @@ -92,6 +92,42 @@ if %requestType% == 'PATH_INFO' ( echo %syncgit% > %baseDir%syncgit.bat echo syncgit.bat ok +:: async send mail. +if %requestType% == 'PATH_INFO' ( + SET sendmail= %phpcli% %baseDir%ztcli "%pmsRoot%/mail-asyncSend" +)else ( + SET sendmail= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=mail&f=asyncSend" +) +echo %sendmail% > %baseDir%sendmail.bat +echo sendmail.bat ok + +:: async send webhook. +if %requestType% == 'PATH_INFO' ( + SET sendwebhook= %phpcli% %baseDir%ztcli "%pmsRoot%/webhook-asyncSend" +)else ( + SET sendwebhook= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=webhook&f=asyncSend" +) +echo %sendwebhook% > %baseDir%sendwebhook.bat +echo sendwebhook.bat ok + +:: create cycle todo. +if %requestType% == 'PATH_INFO' ( + SET createcycle= %phpcli% %baseDir%ztcli "%pmsRoot%/todo-createCycle" +)else ( + SET createcycle= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=todo&f=createCycle" +) +echo %createcycle% > %baseDir%createcycle.bat +echo createcycle.bat ok + +:: delete log. +if %requestType% == 'PATH_INFO' ( + SET deletelog= %phpcli% %baseDir%ztcli "%pmsRoot%/admin-deleteLog" +)else ( + SET deletelog= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=admin&f=deleteLog" +) +echo %deletelog% > %baseDir%deletelog.bat +echo deletelog.bat ok + :: create crond.bat SET cron= %phpcli% %baseDir%php\crond.php echo %cron% > %baseDir%crond.bat @@ -106,6 +142,10 @@ echo 1 1 * * * %baseDir%backup.bat # backup database an echo 1 23 * * * %baseDir%computeburn.bat # compute burndown chart. >> %sysCron% echo 1-59/2 * * * * %baseDir%syncsvn.bat # sync subversion. >> %sysCron% echo 1-59/2 * * * * %baseDir%syncgit.bat # sync git. >> %sysCron% +echo 1-59/5 * * * * %baseDir%sendmail.bat # async send mail. >> %sysCron% +echo 1-59/5 * * * * %baseDir%sendwebhook.bat # async send webhook. >> %sysCron% +echo 1 1 * * * %baseDir%createcycle.bat # create cycle todo. >> %sysCron% +echo 30 1 * * * %baseDir%deletelog.bat # delete log. >> %sysCron% :: return 0 when success. exit /b 0 diff --git a/bin/init.sh b/bin/init.sh index 61fc4c5b47..ae5053b7f6 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -95,6 +95,42 @@ fi echo $syncgit > $basePath/syncgit.sh echo "syncgit.sh ok" +# async send mail. +if [ $requestType == 'PATH_INFO' ]; then + mailsend="$phpcli $basePath/ztcli '$pmsRoot/mail-asyncSend'"; +else + mailsend="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=mail&f=asyncSend'"; +fi +echo $mailsend > $basePath/sendmail.sh +echo "sendmail.sh ok" + +# async send webhook. +if [ $requestType == 'PATH_INFO' ]; then + sendwebhook="$phpcli $basePath/ztcli '$pmsRoot/webhook-asyncSend'"; +else + sendwebhook="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=webhook&f=asyncSend'"; +fi +echo $sendwebhook > $basePath/sendwebhook.sh +echo "sendwebhook.sh ok" + +# create cycle todo. +if [ $requestType == 'PATH_INFO' ]; then + createcycle="$phpcli $basePath/ztcli '$pmsRoot/todo-createCycle'"; +else + createcycle="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=todo&f=createCycle'"; +fi +echo $createcycle > $basePath/createcycle.sh +echo "createcycle.sh ok" + +# delete log. +if [ $requestType == 'PATH_INFO' ]; then + deletelog="$phpcli $basePath/ztcli '$pmsRoot/admin-deleteLog'"; +else + deletelog="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=admin&f=deleteLog'"; +fi +echo $deletelog > $basePath/deletelog.sh +echo "deletelog.sh ok" + # cron if [ ! -d "$basePath/cron" ]; then mkdir $basePath/cron @@ -105,7 +141,11 @@ echo "0 1 * * * $basePath/dailyreminder.sh # dailyreminder." echo "1 1 * * * $basePath/backup.sh # backup database and file." >> $basePath/cron/sys.cron echo "1 23 * * * $basePath/computeburn.sh # compute burndown chart." >> $basePath/cron/sys.cron echo "1-59/2 * * * * $basePath/syncsvn.sh # sync subversion." >> $basePath/cron/sys.cron -echo "1-59/2 * * * * $basePath/syncgit.sh # sync git" >> $basePath/cron/sys.cron +echo "1-59/2 * * * * $basePath/syncgit.sh # sync git." >> $basePath/cron/sys.cron +echo "1-59/5 * * * * $basePath/sendmail.sh # async send mail." >> $basePath/cron/sys.cron +echo "1-59/5 * * * * $basePath/sendwebhook.sh # async send webhook." >> $basePath/cron/sys.cron +echo "1 1 * * * $basePath/createcycle.sh # create cycle todo." >> $basePath/cron/sys.cron +echo "30 1 * * * $basePath/deletelog.sh # delete log." >> $basePath/cron/sys.cron cron="$phpcli $basePath/php/crond.php" echo $cron > $basePath/cron.sh echo "cron.sh ok"