Skip to content

Commit

Permalink
Merge branch 'release/1.97.28'
Browse files Browse the repository at this point in the history
  • Loading branch information
tkn98 committed Feb 10, 2017
2 parents 4630f97 + 8813d89 commit 56ee911
Show file tree
Hide file tree
Showing 91 changed files with 2,689 additions and 1,369 deletions.
24 changes: 5 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
# Composer
vendor/
/vendor/

# Phpunit
phpunit.xml

# Build files
composer.phar
n98-magerun.phar
build/out/
# Build
/n98-magerun.phar
/build/output/

# Magerun stopfile
.n98-magerun

# Miscellaneous (Kraut und Rueben)
.DS_Store
.idea
example-magento
clover.xml
clover
/.project
doc/**
reports/**
/.n98-magerun
1 change: 1 addition & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ return Symfony\CS\Config::create()
'newline_after_open_tag',
'ordered_use',
'standardize_not_equal',
/* php 5.3 compat */ 'class_keyword_remove', 'long_array_syntax ',
)
)
)
Expand Down
53 changes: 28 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ branches:
- master
- develop
- /^(bugfix|feature)\/.*$/
- interop

php:
- 5.3
Expand All @@ -17,6 +16,9 @@ env:
global:
- DB=mysql
matrix:
- SCRIPT_JOB="PHP-CS-FIXER"
- SCRIPT_JOB="BUILDSH"
- SCRIPT_JOB="BASH-AUTOCOMPLETION"
- MAGENTO_VERSION="magento-mirror-1.4.2.0" INSTALL_SAMPLE_DATA=yes
- MAGENTO_VERSION="magento-mirror-1.5.1.0" INSTALL_SAMPLE_DATA=yes
- MAGENTO_VERSION="magento-mirror-1.6.2.0" INSTALL_SAMPLE_DATA=yes
Expand Down Expand Up @@ -64,31 +66,33 @@ matrix:
include:
# Lint PHP code with future PHP versions (forward compatibility)
- php: 7.0
env: LINTSH=1
script: find {src,tests} -name "*.php" ! -path '*/String.php' -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected'; test $? -eq 1
env: SCRIPT_JOB=LINTSH
script: find {src,tests} -name "*.php" ! -path '*/String.php' -print0 | xargs
-0 -n1 -P8 php -l | grep -v '^No syntax errors detected'; test $? -eq 1
- php: 7.1
env: LINTSH=1
script: find {src,tests} -name "*.php" ! -path '*/String.php' -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected'; test $? -eq 1
# Run the build script with different PHP versions
- php: 5.3
env: BUILDSH=1
script: build/travis/build.sh
- php: 5.4
env: BUILDSH=1
script: build/travis/build.sh
- php: 5.5
env: BUILDSH=1
script: build/travis/build.sh
env: SCRIPT_JOB=LINTSH
script: find {src,tests} -name "*.php" ! -path '*/String.php' -print0 | xargs
-0 -n1 -P8 php -l | grep -v '^No syntax errors detected'; test $? -eq 1
# Run the cs-fixer and build script with different PHP versions
- php: 5.6
env: SCRIPT_JOB="PHP-CS-FIXER"
- php: 5.6
env: SCRIPT_JOB="BUILDSH"
- php: 5.6
env: BUILDSH=1
script: build/travis/build.sh
env: SCRIPT_JOB="BASH-AUTOCOMPLETION"
- php: 7.0
env: BUILDSH=1
script: build/travis/build.sh
env: SCRIPT_JOB="PHP-CS-FIXER"
- php: 7.0
env: SCRIPT_JOB="BUILDSH"
- php: 7.0
env: SCRIPT_JOB="BASH-AUTOCOMPLETION"
- php: 7.1
env: SCRIPT_JOB="PHP-CS-FIXER"
- php: 7.1
env: SCRIPT_JOB="BUILDSH"
- php: 7.1
env: BUILDSH=1
script: build/travis/build.sh
# Run with current PHP 5.6 and PHP 7.0 version
env: SCRIPT_JOB="BASH-AUTOCOMPLETION"
# Run with current PHP 5.6 and PHP 7.0 version (as not set in matrix)
- php: 5.6
env: MAGENTO_VERSION="magento-mirror-1.9.2.4" DB=mysql INSTALL_SAMPLE_DATA=no
- php: 5.6
Expand All @@ -110,11 +114,10 @@ before_install:
- travis_retry composer global require hirak/prestissimo

install:
- travis_retry composer install --prefer-source --no-interaction --ignore-platform-reqs
- travis_retry composer install --prefer-dist --no-interaction --ignore-platform-reqs

before_script:
- source build/travis/before_script.sh

script:
- vendor/bin/php-cs-fixer --diff --dry-run -v fix
- vendor/bin/phpunit --debug --stop-on-error --stop-on-failure
- build/travis/script.sh
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
RECENT CHANGES
==============

1.97.28
-------
* Fix: sys:setup:run exists with code 0 on error (report by Matías Montes, fix by Tom Klingenberg, #854)
* Fix: URL generation in sys:cron:run (report by Ash Smith, fix by Tom Klingenberg, #871)
* Fix: Indexer dies on error (report by Henry Hirsch, fix by Tom Klingenberg, #701)
* Fix: Incompatibilities with PHP 7.1 (report by Don Bosco van Hoi, fix by Tom Klingenberg, #881)
* Fix: Warning db:import sprintf too few arguments (report by Peter Jaap Blaakmeer, fix by Tom Klingenberg, #884)
* Fix: Empty database hostname for mysql cli (report by Seansan, fix by Tom Klingenberg, #880)
* Imp: Build phar reproduceable and from dev requirements (by Tom Klingenberg)
* Imp: Support NULL values in config:set and config:get (by Tom Klingenberg)
* New: Add index:list:mview and index:reindex:mview commands (by Luke Rodgers, #891)
* New: Add --include parameter to db:dump command (by Jarod Hayes, #848)

1.97.27
-------
* Fix: Sourceforge moved to https (by Tom Klingenberg)
Expand Down Expand Up @@ -32,6 +45,7 @@ RECENT CHANGES
* Imp: Create controllers folder in dev:module:create command (by Alexander Turiak, #835)
* Imp: Update example to use config:search command (by Hardy Johnson, #834)
* Imp: Build in clean directory (by Tom Klingenberg)
* New: Add --reinit and --no-reninit options for cache:clean and cache:flush (by arollason, #863)
* New: Add Magento CE 1.9.3.1 to config.yaml (by Tom Klingenberg, #872)
* New: Add Magento CE 1.9.3.0 to config.yaml (by Marty S/sylink, #867)
* New: Coding standard defintion and checks (by Tom Klingenberg)
Expand Down
1 change: 1 addition & 0 deletions bin/compile-bash-autocompletion
96 changes: 35 additions & 61 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,31 @@ remove_assume_unchanged() {
)
}

exit_trap() {
local status=$?
if [[ -d "${base_dir}/${build_dir}" ]]; then
echo "trap: removing '${build_dir}'.."
rm -rf "${base_dir}/${build_dir}"
fi
echo "exit ($status)."
}

name="$(awk '/<project name="([^"]*)"/ && !done {print gensub(/<project name="([^"]*)".*/, "\\1", "g"); done=1}' build.xml)"
nice_name="$(php -r "echo str_replace(' ', '', ucwords(strtr('${name}', '-', ' ')));")"
phar="${name}.phar"

echo "Building ${phar}..."

# remove stub which is also the build result destination, so if build fails the file does not exists
remove_assume_unchanged "." "${phar}"

base_dir="$(pwd -P)"
build_dir="build/output"

echo "$0 executed in ${base_dir}"

build_dir="build/output"
finish() {
echo "trap exit removing '${build_dir}'.."
rm -rf "${base_dir}/${build_dir}"
}
trap finish EXIT
trap exit_trap EXIT

if [[ -d "${build_dir}" ]]; then
rm -rf "${build_dir}"
fi
rm -rf "${build_dir}"
if [[ -d "${build_dir}" ]]; then
>&2 echo "Error: Can not remove build-dir '${build_dir}'"
echo "aborting."
Expand All @@ -48,79 +53,48 @@ if [[ ! -d "${build_dir}" ]]; then
exit 1
fi

git clone --quiet --no-local -- . "${build_dir}"
git clone --quiet --no-local --depth 1 -- . "${build_dir}"
# remove fake-phar directly after clone
remove_assume_unchanged "${build_dir}" "n98-magerun.phar"

composer="${build_dir}/composer.phar"

if [[ -e "${composer}" ]]; then
rm "${composer}"
fi
composer_bin="${base_dir}/vendor/bin/composer"
phing_bin="${base_dir}/vendor/bin/phing"

# Set COMPOSER_HOME if HOME and COMPOSER_HOME not set (shell with no home-dir, e.g. build server with webhook)
if [[ -z ${HOME+x} ]]; then
if [ -z ${COMPOSER_HOME+x} ]; then
mkdir -p "build/composer-home"
export COMPOSER_HOME="$(pwd -P)/build/composer-home"
fi
if [[ -z ${HOME+x} && -z ${COMPOSER_HOME+x} ]]; then
echo "provision: create COMPOSER_HOME directory for composer (no HOME)"
mkdir -p "build/composer-home"
export COMPOSER_HOME="$(pwd -P)/build/composer-home"
fi

if [[ ! -e "${composer}" ]]; then
echo "Downloading composer.phar..."
wget --quiet -O "${composer}" https://getcomposer.org/download/1.1.3/composer.phar
chmod +x "${composer}"
fi

"${composer}" --version
php --version

echo "Composer install in '${build_dir}'..."
if ! "${composer}" -d="${build_dir}" --profile -q install --no-dev --no-interaction; then
echo "failed to install from composer.lock, installing without lockfile now"
rm "${build_dir}"/composer.lock
"${composer}" -d="${build_dir}" --profile -q install --no-dev --no-interaction
fi

echo "Composer install build requirements in '${build_dir}/build'..."
"${composer}" -d="${build_dir}"/build --profile -q install --no-interaction

if [[ -e "${phar}" ]]; then
echo "Remove earlier created ${phar} file"
rm "${phar}"
fi
echo "with: $(php --version|head -n 1)"
echo "with: $("${composer_bin}" --version)"
echo "with: $("${phing_bin}" -version)"

cd "${build_dir}"

echo "building in $(pwd -P)"
git --no-pager log --oneline -1
echo "build version: $(git --no-pager log --oneline -1)"

echo "setting ulimits (new setting is to $(ulimit -Hn))..."
echo "provision: ulimits (soft) set from $(ulimit -Sn) to $(ulimit -Hn) (hard) for faster phar builds..."
ulimit -Sn $(ulimit -Hn)
timestamp="$(git log --format=format:%ct HEAD -1)" # reproduceable build
echo "build timestamp: ${timestamp}"

echo "invoking phing dist_clean target..."
set +e
php -f build/vendor/phing/phing/bin/phing -dphar.readonly=0 -- dist_clean
BUILD_STATUS=$?
set -e
if [[ ${BUILD_STATUS} -ne 0 ]]; then
>&2 echo "error: phing build failed with exit status ${BUILD_STATUS}"
echo "aborting."
exit ${BUILD_STATUS}
fi
php -f "${phing_bin}" -dphar.readonly=0 -- \
-Dcomposer_suffix="${nice_name}${timestamp}" \
-Dcomposer_bin="${composer_bin}" \
dist_clean

php -f build/phar/phar-timestamp.php

php -f "${phar}" -- --version

ls -al "${phar}"

php -r 'echo "SHA1: ", sha1_file("'"${phar}"'"), "\nMD5.: ", md5_file("'"${phar}"'"), "\n";'

cd -

cp -vp "${build_dir}"/"${phar}" "${phar}"

rm -rf "${build_dir}"

trap - EXIT

echo "done."
Loading

0 comments on commit 56ee911

Please sign in to comment.