Skip to content

Commit

Permalink
Merge pull request #38 from ubccr/xdmod7.0
Browse files Browse the repository at this point in the history
Merge 7.0 work into 7.1
  • Loading branch information
tyearke authored Sep 21, 2017
2 parents de36161 + 480e299 commit 978b674
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 76 deletions.
80 changes: 42 additions & 38 deletions .travis.build.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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=()
Expand All @@ -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.
Expand All @@ -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"
Expand Down Expand Up @@ -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..."
Expand All @@ -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..."
Expand Down
39 changes: 6 additions & 33 deletions .travis.install.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
-----------------

Expand Down
3 changes: 2 additions & 1 deletion build.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 16 additions & 2 deletions xdmod-appkernels.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <[email protected]> 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 <[email protected]> 6.6.0-1.0
- Miscellaneous
- Updated for compatibility with Open XDMoD 6.6.0
Expand Down

0 comments on commit 978b674

Please sign in to comment.