move eslint into env matrix + other build tweaks

This commit is contained in:
Andrew Bauer 2019-12-25 08:41:53 -06:00
parent 69abf2d314
commit 73aba586d4
3 changed files with 35 additions and 20 deletions

View File

@ -51,6 +51,7 @@ env:
- SMPFLAGS=-j4 OS=debian DIST=buster ARCH=i386 - SMPFLAGS=-j4 OS=debian DIST=buster ARCH=i386
- SMPFLAGS=-j4 OS=debian DIST=stretch ARCH=i386 - SMPFLAGS=-j4 OS=debian DIST=stretch ARCH=i386
- SMPFLAGS=-j4 OS=raspbian DIST=stretch ARCH=armhf DOCKER_REPO=knnniggett/packpack - SMPFLAGS=-j4 OS=raspbian DIST=stretch ARCH=armhf DOCKER_REPO=knnniggett/packpack
- SMPFLAGS=-j4 OS=eslint DIST=eslint
compiler: compiler:
- gcc - gcc
@ -58,12 +59,6 @@ services:
- mysql - mysql
- docker - docker
jobs:
include:
- name: eslint
install: npm install -g eslint@5.12.0 eslint-config-google@0.11.0 eslint-plugin-html@5.0.0 eslint-plugin-php-markup@0.2.5
script: eslint --ext .php,.js .
script: script:
- utils/packpack/startpackpack.sh - utils/packpack/startpackpack.sh

View File

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
# We don't deploy during eslint checks, so exit immediately
if [ "${DIST}" == "eslint" ]; then
exit 0
fi
# Check to see if this script has access to all the commands it needs # Check to see if this script has access to all the commands it needs
for CMD in sshfs rsync find fusermount mkdir; do for CMD in sshfs rsync find fusermount mkdir; do
type $CMD 2>&1 > /dev/null type $CMD 2>&1 > /dev/null
@ -29,16 +34,15 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${OS}" == "debian" ] || [ "${OS}"
echo echo
echo "Running \$(rsync -v -e 'ssh -vvv' build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1)" echo "Running \$(rsync -v -e 'ssh -vvv' build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1)"
rsync -v -e 'ssh -vvv' build/* zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1 rsync -v --ignore-missing-args -e 'ssh -vvv' build/*.{rpm,deb,dsc,tar.xz,changes} zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1
result="$?" if [ "$?" -eq 0 ]; then
if [ "$result" -eq 0 ]; then
echo echo
echo "Files copied successfully." echo "Files copied successfully."
echo echo
else else
echo echo
echo "ERROR: Attempt to rsync to zmrepo.zoneminder.com failed!" echo "ERROR: Attempt to rsync to zmrepo.zoneminder.com failed!"
echo "The following error code was returned: $result." echo "See log output for details."
echo echo
exit 99 exit 99
fi fi

View File

@ -150,7 +150,7 @@ install_deb () {
exit 1 exit 1
fi fi
# Install and test the zoneminder package (only) for Ubuntu Trusty # Install and test the zoneminder package (only) for Ubuntu Xenial
pkgname="build/zoneminder_${VERSION}-${RELEASE}_amd64.deb" pkgname="build/zoneminder_${VERSION}-${RELEASE}_amd64.deb"
if [ -e $pkgname ]; then if [ -e $pkgname ]; then
@ -276,6 +276,8 @@ checkdeploytarget () {
echo echo
traceroute -w 2 -m 15 ${DEPLOYTARGET} traceroute -w 2 -m 15 ${DEPLOYTARGET}
fi fi
exit 97
} }
################ ################
@ -326,8 +328,9 @@ if [ "${OS}" == "el" ] || [ "${OS}" == "fedora" ]; then
echo "Starting packpack..." echo "Starting packpack..."
execpackpack execpackpack
fi; fi
# Steps common to Debian based distros
# Steps common to Debian based distros
elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ] || [ "${OS}" == "raspbian" ]; then elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ] || [ "${OS}" == "raspbian" ]; then
commonprep commonprep
echo "Begin ${OS} ${DIST} build..." echo "Begin ${OS} ${DIST} build..."
@ -348,14 +351,27 @@ elif [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ] || [ "${OS}" == "raspbia
echo "Starting packpack..." echo "Starting packpack..."
execpackpack execpackpack
# We were not triggered via cron so just build and test trusty # Try to install and run the newly built zoneminder package
if [ "${OS}" == "ubuntu" ] && [ "${DIST}" == "xenial" ] && [ "${ARCH}" == "x86_64" ]; then if [ "${OS}" == "ubuntu" ] && [ "${DIST}" == "xenial" ] && [ "${ARCH}" == "x86_64" ] && [ "${TRAVIS}" == "true" ]; then
# If we are running inside Travis then attempt to install the deb we just built echo "Begin Deb package installation..."
if [ "${TRAVIS}" == "true" ]; then
install_deb install_deb
fi
fi fi
# Steps common to eslint checks
elif [ "${OS}" == "eslint" ] || [ "${DIST}" == "eslint" ]; then
# Check we've got npm installed
type npm 2>&1 > /dev/null
if [ $? -ne 0 ]; then
echo
echo "ERROR: The script cannot find the required command \"npm\"."
echo
exit 1
fi
npm install -g eslint@5.12.0 eslint-config-google@0.11.0 eslint-plugin-html@5.0.0 eslint-plugin-php-markup@0.2.5
echo "Begin eslint checks..."
eslint --ext .php,.js .
fi fi
exit 0