diff --git a/.travis.build.sh b/.travis.build.sh index c3b3c81..7dd8dd3 100755 --- a/.travis.build.sh +++ b/.travis.build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash +PATH="$(pwd)/vendor/bin:$(pwd)/node_modules/.bin:$(pwd)/../xdmod/vendor/bin:$PATH" export PATH -PATH="$(pwd)/vendor/bin:$(pwd)/node_modules/.bin:$PATH" source ~/.nvm/nvm.sh nvm use "$NODE_VERSION" @@ -35,7 +35,7 @@ if [ "$TEST_SUITE" = "syntax" ] || [ "$TEST_SUITE" = "style" ]; then files_changed=() while IFS= read -r -d $'\0' file; do files_changed+=("$file") - done < <(git diff --name-only --diff-filter=d -z "$TRAVIS_COMMIT_RANGE") + done < <(git diff --name-only --diff-filter=da -z "$TRAVIS_COMMIT_RANGE") # Separate the changed files by language. php_files_changed=() @@ -50,6 +50,17 @@ if [ "$TEST_SUITE" = "syntax" ] || [ "$TEST_SUITE" = "style" ]; then json_files_changed+=("$file") fi done + + # Get any added files by language + php_files_added=() + js_files_added=() + while IFS= read -r -d $'\0' file; do + if [[ "$file" == *.php ]]; then + php_files_added+=("$file") + elif [[ "$file" == *.js ]]; then + js_files_added+=("$file") + fi + done < <(git diff --name-only --diff-filter=A -z "$TRAVIS_COMMIT_RANGE") fi # Build tests require the corresponding version of Open XDMoD. @@ -58,26 +69,9 @@ if [ "$TEST_SUITE" = "build" ]; then echo "Cloning Open XDMoD branch '$xdmod_branch'" git clone --depth=1 --branch="$xdmod_branch" https://github.com/ubccr/xdmod.git ../xdmod - # If PHP 5.3.3 is installed, SSL/TLS isn't available to PHP. - # Use a newer version of PHP for installing Composer dependencies. - using_php_533="false"; [[ "$(php --version)" == PHP\ 5.3.3\ * ]] && using_php_533="true" - if "$using_php_533"; then - echo "Using newer version of PHP for installing dependencies" - phpenv global 5.3 - php --version - fi - - # Install Composer dependencies. - pushd ../xdmod >/dev/null - composer install - popd >/dev/null - - # If using PHP 5.3.3 for testing purposes, stop using the newer PHP version. - if "$using_php_533"; then - echo "Reverting back to PHP 5.3.3 for testing" - phpenv global 5.3.3 - php --version - fi + pushd ../xdmod + . .travis.install.sh + popd # Create a symlink from Open XDMoD to this module. ln -s "$(pwd)" "../xdmod/open_xdmod/modules/$module_dir" @@ -105,28 +99,45 @@ if [ "$TEST_SUITE" = "syntax" ]; then fi done elif [ "$TEST_SUITE" = "style" ]; then + npm install https://github.com/jpwhite4/lint-diff/tarball/master + for file in "${php_files_changed[@]}"; do + phpcs "$file" --report=json > "$file.lint.new.json" + if [ $? != 0 ]; then + git show "$commit_range_start:$file" | phpcs --stdin-path="$file" --report=json > "$file.lint.orig.json" + ./node_modules/.bin/lint-diff "$file.lint.orig.json" "$file.lint.new.json" + if [ $? != 0 ]; then + build_exit_value=2 + fi + rm "$file.lint.orig.json" + fi + rm "$file.lint.new.json" + done + for file in "${php_files_added[@]}"; do phpcs "$file" if [ $? != 0 ]; then build_exit_value=2 fi done for file in "${js_files_changed[@]}"; do + eslint "$file" -f json > "$file.lint.new.json" + if [ $? != 0 ]; then + git show "$commit_range_start:$file" | eslint --stdin --stdin-filename "$file" -f json > "$file.lint.orig.json" + ./node_modules/.bin/lint-diff "$file.lint.orig.json" "$file.lint.new.json" + if [ $? != 0 ]; then + build_exit_value=2 + fi + rm "$file.lint.orig.json" + fi + rm "$file.lint.new.json" + done + for file in "${js_files_added[@]}"; do eslint "$file" if [ $? != 0 ]; then build_exit_value=2 fi done elif [ "$TEST_SUITE" = "build" ]; then - # If PHP 5.3.3 is installed, SSL/TLS isn't available to PHP. - # Use a newer version of PHP for installing Composer dependencies. - using_php_533="false"; [[ "$(php --version)" == PHP\ 5.3.3\ * ]] && using_php_533="true" - if "$using_php_533"; then - echo "Using newer version of PHP for installing dependencies" - phpenv global 5.3 - php --version - fi - echo "Building Open XDMoD..." ../xdmod/open_xdmod/build_scripts/build_package.php --module xdmod echo "Building $module_name module..." @@ -135,13 +146,6 @@ elif [ "$TEST_SUITE" = "build" ]; then build_exit_value=2 fi - # If using PHP 5.3.3 for testing purposes, stop using the newer PHP version. - if "$using_php_533"; then - echo "Reverting back to PHP 5.3.3 for testing" - phpenv global 5.3.3 - php --version - fi - xdmod_install_dir="$HOME/xdmod-install" echo "Installing Open XDMoD..." diff --git a/.travis.install.sh b/.travis.install.sh index 0b57ed8..ce4d301 100755 --- a/.travis.install.sh +++ b/.travis.install.sh @@ -1,43 +1,16 @@ #!/usr/bin/env bash -function install_pear_dependencies() { - pear install Log -} - -# If PHP 5.3.3 is installed, SSL/TLS isn't available to PHP. -# Use a newer version of PHP for installing Composer dependencies. -using_php_533="false"; [[ "$(php --version)" == PHP\ 5.3.3\ * ]] && using_php_533="true" -if "$using_php_533"; then - echo "Using newer version of PHP for installing dependencies" - phpenv global 5.3 - php --version - - # Update Composer since the attempt made by the Travis setup script - # using PHP 5.3.3 would have failed. - # - # First, we update to the latest developer version since the version - # of Composer pre-installed on Travis systems (1.0.0) doesn't support - # selecting an update channel. Then, we use this version to rollback to - # the latest stable version. - composer self-update - composer self-update --stable - - # Install PEAR dependencies for newer version of PHP. - install_pear_dependencies -fi +composer self-update --stable # Install Composer dependencies. composer install -# If using PHP 5.3.3 for testing purposes, stop using the newer PHP version. -if "$using_php_533"; then - echo "Reverting back to PHP 5.3.3 for testing" - phpenv global 5.3.3 - php --version -fi +#fix for https://github.com/travis-ci/travis-ci/issues/8365 +pear config-set php_dir $(php -r 'echo substr(get_include_path(),2);') -# Install PEAR dependencies for testing version of PHP. -install_pear_dependencies +pear channel-update pear.php.net +# Install PEAR dependencies. +pear install --alldeps Log # Install npm dependencies. source ~/.nvm/nvm.sh diff --git a/.travis.yml b/.travis.yml index d369d02..1b54f48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,9 @@ dist: precise # Specify the build matrix language: php php: - - '5.3.3' - '5.4' + - '7.0' + - '7.1.6' env: global: - NODE_VERSION=6 @@ -21,7 +22,9 @@ matrix: allow_failures: - env: TEST_SUITE=style exclude: - - php: '5.4' + - php: '7.0' + env: TEST_SUITE=style + - php: '7.1.6' env: TEST_SUITE=style # Add dependency directories to the Travis cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cb5eb5..c14db8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ Open XDMoD Application Kernels Change Log ========================================= +## 2017-09-21 v7.0.0 + +- Bug Fixes + - Fixed various compatibility issues with PHP 7 ([\#18](https://github.com/ubccr/xdmod-appkernels/pull/18)) + - Fixed issue that allowed incompatible versions of XDMoD and this module to be installed when installing via RPM ([\#35](https://github.com/ubccr/xdmod-appkernels/pull/35)) +- Miscellaneous + - Updated for compatibility with Open XDMoD 7.0.0 ([\#20](https://github.com/ubccr/xdmod-appkernels/pull/20), [\#28](https://github.com/ubccr/xdmod-appkernels/pull/28), [\#29](https://github.com/ubccr/xdmod-appkernels/pull/29)) + - Improved development workflow ([\#21](https://github.com/ubccr/xdmod-appkernels/pull/21)) + - Improved quality assurance ([\#22](https://github.com/ubccr/xdmod-appkernels/pull/22), [\#27](https://github.com/ubccr/xdmod-appkernels/pull/27), [\#30](https://github.com/ubccr/xdmod-appkernels/pull/30), [\#37](https://github.com/ubccr/xdmod-appkernels/pull/37)) + 2017-05-11 v6.6.0 ----------------- diff --git a/build.json b/build.json index adb9a51..53a7500 100644 --- a/build.json +++ b/build.json @@ -38,7 +38,8 @@ "configuration/roles.json": "roles.d/appkernels.json", "configuration/setup.json": "setup.d/appkernels.json", "configuration/rest.d": "rest.d", - "configuration/assets.d": "assets.d" + "configuration/assets.d": "assets.d", + "configuration/modules.d/appkernels.json": "modules.d/appkernels.json" }, "etc/crond": { "configuration/cron.conf": "xdmod-appkernels" diff --git a/xdmod-appkernels.spec.in b/xdmod-appkernels.spec.in index 38e9826..837fee0 100644 --- a/xdmod-appkernels.spec.in +++ b/xdmod-appkernels.spec.in @@ -11,7 +11,7 @@ Source: %{name}-%{version}__PRERELEASE__.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}__PRERELEASE__-%{release}-XXXXXX) BuildArch: noarch BuildRequires: php-cli -Requires: xdmod >= 7.0.0 +Requires: xdmod >= 7.0.0, xdmod < 7.1.0 %description This package provides application kernel support for Open XDMoD. The @@ -51,14 +51,28 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/xdmod/ %{_datadir}/xdmod/ %{_docdir}/%{name}-%{version}__PRERELEASE__/ +%{_sysconfdir}/xdmod/modules.d/appkernels.json %config(noreplace) %{_sysconfdir}/xdmod/*.d/appkernels.ini -%config(noreplace) %{_sysconfdir}/xdmod/*.d/appkernels.json +%config(noreplace) %{_sysconfdir}/xdmod/assets.d/appkernels*.json +%config(noreplace) %{_sysconfdir}/xdmod/internal_dashboard.d/appkernels*.json +%config(noreplace) %{_sysconfdir}/xdmod/roles.d/appkernels*.json +%config(noreplace) %{_sysconfdir}/xdmod/setup.d/appkernels*.json %config(noreplace) %{_sysconfdir}/xdmod/rest.d/akrr.json %config(noreplace) %{_sysconfdir}/xdmod/rest.d/app_kernel.json %config(noreplace) %{_sysconfdir}/cron.d/%{name} %changelog +* Thu Sep 21 2017 Jeffrey T. Palmer 7.0.0-1.0 +- Bug Fixes + - Fixed various compatibility issues with PHP 7 + - Fixed issue that allowed incompatible versions of XDMoD and this module + to be installed when installing via RPM +- Miscellaneous + - Updated for compatibility with Open XDMoD 7.0.0 + - Improved development workflow + - Improved quality assurance + * Thu May 11 2017 Jeffrey T. Palmer 6.6.0-1.0 - Miscellaneous - Updated for compatibility with Open XDMoD 6.6.0