diff --git a/travisCI/change-file.sh b/travisCI/change-file.sh index 44877b7dc..c75caeb3c 100755 --- a/travisCI/change-file.sh +++ b/travisCI/change-file.sh @@ -22,9 +22,11 @@ git checkout master # Modify our file and make sure Travis is owner sudo $TRAVIS_BUILD_DIR/travisCI/modify-globalblacklist.sh +sudo $TRAVIS_BUILD_DIR/travisCI/modify-readme.sh sudo chown -R travis:travis $TRAVIS_BUILD_DIR/* # Add the modified file to the and commit it +git add $TRAVIS_BUILD_DIR/README.md git add $TRAVIS_BUILD_DIR/conf.d/globalblacklist.conf git add $TRAVIS_BUILD_DIR/Engintron_for_cPanel_WHM_Configuration_Example/etc/nginx/conf.d/globalblacklist.conf git commit -am "V3.$YEAR.$MONTH.$TRAVIS_BUILD_NUMBER [ci skip]" diff --git a/travisCI/install-nginx.sh b/travisCI/install-nginx.sh index 7cb59778c..ddef180cb 100755 --- a/travisCI/install-nginx.sh +++ b/travisCI/install-nginx.sh @@ -58,6 +58,7 @@ sudo ./update-ngxblocker # Set all our other setup and deploy scripts to be executable sudo chmod +x $TRAVIS_BUILD_DIR/travisCI/modify-globalblacklist.sh +sudo chmod +x $TRAVIS_BUILD_DIR/travisCI/modify-readme.sh sudo chmod +x $TRAVIS_BUILD_DIR/travisCI/deploy-package.sh sudo chmod +x $TRAVIS_BUILD_DIR/travisCI/change-file.sh diff --git a/travisCI/modify-readme.sh b/travisCI/modify-readme.sh new file mode 100755 index 000000000..24da08bf6 --- /dev/null +++ b/travisCI/modify-readme.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Write Build / Version Number into README.md +# Created by: https://github.com/mitchellkrogza (mitchellkrog@gmail.com) +# Copyright: Mitchell Krog - https://github.com/mitchellkrogza + +# Start time of script generation +versionyear=$(date +%Y) +versionmonth=$(date +%m) +MY_GIT_TAG=V3.$versionyear.$versionmonth.$TRAVIS_BUILD_NUMBER + +# Set Temporary database and variables +_inputdbA=/tmp/lastupdated.db +_tmpnginxA=tmpnginxA + +# Start and End Strings to Search for to do inserts into template +_startmarker="### --" +_endmarker="-- ###" + +# PRINT VERSION INFORMATION INTO GLOBALBLACKLIST FILE 1 +# ***************************************************** +VERSIONUMBER=$IFS +IFS=$'\n' +echo $_startmarker >> $_tmpnginxA +printf " Version: "$MY_GIT_TAG "" >> $_tmpnginxA +echo $_endmarker >> $_tmpnginxA +IFS=$VERSIONUMBER +mv $_tmpnginxA $_inputdbA +ed -s $_inputdbA<<\IN +1,/### --/d +/-- ###/,$d +,d +.r /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/README.md +/### --/x +.t. +.,/-- ###/-d +#,p +#,p used to print output replaced with w below to write +w /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/README.md +q +IN +rm $_inputdbA + +exit 0