mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-03 19:20:16 +00:00
TravisCI Now to Handle Releases and Build Numbering
- Preparations for introducing generator scripts and further enhancements to the Bot Blocker - Better tracking of Release Tags and Build Numbering
This commit is contained in:
parent
1c53dc485e
commit
f2563a2935
14 changed files with 83 additions and 19 deletions
39
.travis.yml
39
.travis.yml
|
@ -1,17 +1,17 @@
|
||||||
language: php
|
language: php
|
||||||
env:
|
|
||||||
- WEB_PORT_80_TCP_ADDR=localhost
|
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: trusty
|
||||||
php:
|
env:
|
||||||
- 5.4
|
global:
|
||||||
- 5.5
|
- secure: unp8irwVXz37jxOFbuM4NciRaq326XktPJP0UuL5m1qdrGiLQVq18cIuXClkxbnCoXzpkL0gG1XdjaD0bRKWAnwRRZBEKDRBYXyF+IcGCfG1k8HUbZoV1OTP21qUXot70YrTiZJ3NkuS32RJdFV9qRAkaM1Srf+ZRHcsZSdXaSJTooMsDLtqk9Bjh9aHEltRCDS0AT2YPANZLW4Yn2QcwBmPhv+3xNxRt2etbl1EYvjYGbKw31JJnMHvS15DJEY52coJ+n4Yw/EI9My4O9TshrAEHeWwXT+dGACdNTD9lXkohuEyc10bgWTGeD5jytm5mbVbzlML3iro0sq6gNWr1iBzGL+FkWSR0ezkbADcnxoUwZa7OHwOPcrzmgkNp6jouGk6Xhl7NQgfwJJtQYPWfOuXIVNUk1Z2Ein/lw2WMzGmEHrqs1x2gIrD83sKqULT3kZBWr4RfhUPjol+V0MZJ+KCW2yo+2C8lZDQ5LWxftoqnG/ia70nFemWsyHSqe2OvN4WfwW9zdS0kRqMZVq/r3R+y0idacFkvO5yXk7cS45tAawIUK5Ipc3fib/ERv8zoDjcIt136hXhlYo44vPr2oprDnyvLcCbdG0A4uCnPpp3Bdbcn2NqIlsXhzBV+YJokaTv5zfWSH2YX6+wdv0C3+dkFjpZaASVg/R7oxg/oXY=
|
||||||
- 5.6
|
- GIT_NAME: Travis CI
|
||||||
- 7.0
|
- GIT_EMAIL: builds@travis-ci.org
|
||||||
|
- TRAVIS_REPO_SLUG: mitchellkrogza/nginx-ultimate-bad-bot-blocker
|
||||||
|
- GIT_BRANCH: master
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
php:
|
||||||
- php: hhvm
|
- '5.6'
|
||||||
cache:
|
cache:
|
||||||
- apt
|
- apt
|
||||||
addons:
|
addons:
|
||||||
|
@ -22,7 +22,7 @@ install:
|
||||||
- sudo add-apt-repository -y ppa:nginx/stable
|
- sudo add-apt-repository -y ppa:nginx/stable
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- sudo apt-get install -y --force-yes nginx-extras
|
- sudo apt-get install -y --force-yes nginx-extras
|
||||||
- travis/install-nginx.sh
|
- travisCI/install-nginx.sh
|
||||||
script:
|
script:
|
||||||
- sudo nginx -t &> /dev/stdout
|
- sudo nginx -t &> /dev/stdout
|
||||||
- curl -vsf 'http://localhost:8080/nginx.php' &> /dev/stdout
|
- curl -vsf 'http://localhost:8080/nginx.php' &> /dev/stdout
|
||||||
|
@ -34,3 +34,22 @@ script:
|
||||||
- STATUSCODE=$(curl -I http://localhost:8080/nginx.php -e http://100dollars-seo.com &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
- STATUSCODE=$(curl -I http://localhost:8080/nginx.php -e http://100dollars-seo.com &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
||||||
- STATUSCODE=$(curl -I http://localhost:8080/nginx.php -e http://zyzzcentral.ru &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
- STATUSCODE=$(curl -I http://localhost:8080/nginx.php -e http://zyzzcentral.ru &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
||||||
- cat /tmp/error.log
|
- cat /tmp/error.log
|
||||||
|
- echo $TRAVIS_BUILD_DIR
|
||||||
|
#- travisCI/do-other-stuff.sh
|
||||||
|
before_deploy:
|
||||||
|
- travisCI/deploy.sh
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key:
|
||||||
|
secure: ${GH_TOKEN}
|
||||||
|
file:
|
||||||
|
- "conf.d/globalblacklist.conf"
|
||||||
|
- "bots.d/ddos.conf"
|
||||||
|
- "bots.d/blockbots.conf"
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
repo: mitchellkrogza/nginx-ultimate-bad-bot-blocker
|
||||||
|
tags: false
|
||||||
|
all_branches: true
|
||||||
|
notifications:
|
||||||
|
email: false
|
36
travis-yml.backup
Normal file
36
travis-yml.backup
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
language: php
|
||||||
|
env:
|
||||||
|
- WEB_PORT_80_TCP_ADDR=localhost
|
||||||
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
|
php:
|
||||||
|
- 5.4
|
||||||
|
- 5.5
|
||||||
|
- 5.6
|
||||||
|
- 7.0
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
allow_failures:
|
||||||
|
- php: hhvm
|
||||||
|
cache:
|
||||||
|
- apt
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- realpath
|
||||||
|
install:
|
||||||
|
- sudo add-apt-repository -y ppa:nginx/stable
|
||||||
|
- sudo apt-get update
|
||||||
|
- sudo apt-get install -y --force-yes nginx-extras
|
||||||
|
- travis/install-nginx.sh
|
||||||
|
script:
|
||||||
|
- sudo nginx -t &> /dev/stdout
|
||||||
|
- curl -vsf 'http://localhost:8080/nginx.php' &> /dev/stdout
|
||||||
|
- curl -A "googlebot" http://localhost:8080/nginx.php &> /dev/stdout
|
||||||
|
- curl -A "bingbot" http://localhost:8080/nginx.php &> /dev/stdout
|
||||||
|
- curl -I http://localhost:8080/nginx.php -e http://google.com
|
||||||
|
- STATUSCODE=$(curl -A "80legs" http://localhost:8080/nginx.php &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
||||||
|
- STATUSCODE=$(curl -A "masscan" http://localhost:8080/nginx.php &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
||||||
|
- STATUSCODE=$(curl -I http://localhost:8080/nginx.php -e http://100dollars-seo.com &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
||||||
|
- STATUSCODE=$(curl -I http://localhost:8080/nginx.php -e http://zyzzcentral.ru &> /dev/stderr --write-out "%{http_code}") | if test $STATUSCODE 52; then exit 0; fi
|
||||||
|
- cat /tmp/error.log
|
16
travisCI/deploy.sh
Executable file
16
travisCI/deploy.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
YEAR=$(date +"%Y")
|
||||||
|
MONTH=$(date +"%m")
|
||||||
|
git config --global user.email "${GIT_EMAIL}"
|
||||||
|
git config --global user.name "${GIT_NAME}"
|
||||||
|
git config --global push.default simple
|
||||||
|
git remote add origin https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
|
||||||
|
export GIT_TAG=2.$YEAR-$MONTH.$TRAVIS_BUILD_NUMBER
|
||||||
|
git fetch --tags
|
||||||
|
msg="Tag Generated from TravisCI for build $TRAVIS_BUILD_NUMBER"
|
||||||
|
if git tag $GIT_TAG -a -m "$msg" 2>/dev/null; then
|
||||||
|
git tag $GIT_TAG -a -m "Tag Generated from TravisCI for build $TRAVIS_BUILD_NUMBER"
|
||||||
|
git push origin master && git push origin master --tags
|
||||||
|
ls -aR
|
||||||
|
else echo Tag already exists!; fi
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Travis CI Code Adapted and Modified from 4 Sources
|
# Travis CI Code to Install Nginx
|
||||||
# Thanks go out to:
|
|
||||||
# https://github.com/tburry/travis-nginx-test
|
|
||||||
# https://github.com/alrra/travis-after-all
|
|
||||||
# https://github.com/shoonoise/lua-nginx-statistics
|
|
||||||
# https://github.com/nlindblad/nlindblad.github.io
|
|
||||||
# Without a combination of your Travis CI tests for Nginx I would never have got it working.
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
Loading…
Add table
Reference in a new issue