diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..5a91226 --- /dev/null +++ b/build.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +PLUGIN_NAME="SpLazyLoad" + +commit=$1 +if [ -z ${commit} ]; then + commit=$(git tag | tail -n 1) + if [ -z ${commit} ]; then + commit="master"; + fi +fi + +# Remove old release +rm -rf ${PLUGIN_NAME} ${PLUGIN_NAME}-*.zip + +# Build new release +mkdir -p ${PLUGIN_NAME} +git archive ${commit} | tar -x -C ${PLUGIN_NAME} +composer install --no-dev -n -o -d ${PLUGIN_NAME} +zip -x "*build.sh*" -x "*.MD" -r ${PLUGIN_NAME}-${commit}.zip ${PLUGIN_NAME} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..ffae3b0 --- /dev/null +++ b/composer.json @@ -0,0 +1,13 @@ +{ + "name": "stefanpoensgen/sp-lazy-load", + "keywords": ["shopware", "shopware-plugin"], + "description": "Simple integration of lazysizes into Shopware", + "license": "MIT", + "type": "shopware-plugin", + "extra": { + "installer-name": "SpLazyLoad" + }, + "require": { + "composer/installers": "~1.0" + } +} diff --git a/travis.yml b/travis.yml new file mode 100644 index 0000000..daaccd6 --- /dev/null +++ b/travis.yml @@ -0,0 +1,51 @@ +language: php + +php: + - 7.0 + - 7.1 + - 7.2 + - 7.3 + - nightly + +sudo: false + +services: + - mysql + +env: + matrix: + - SHOPWARE_VERSION="5.3" + - SHOPWARE_VERSION="5.4" + - SHOPWARE_VERSION="5.5" + global: + - PLUGIN_NAME=SpLazyLoad + - SHOPWARE_DIRECTORY=${HOME}/shopware + - PLUGIN_DIRECTORY=${SHOPWARE_DIRECTORY}/custom/plugins + +cache: + directories: + - ${HOME}/.composer/cache/files + +install: + - composer install + +before_script: + - if [[ "$(php --version | grep -cim1 xdebug)" -ge 1 ]]; then phpenv config-rm xdebug.ini; fi + - git clone https://github.com/shopware/shopware.git ${SHOPWARE_DIRECTORY} --branch ${SHOPWARE_VERSION} + - ant -f ${SHOPWARE_DIRECTORY}/build/build.xml -Dapp.host=localhost -Ddb.user=travis -Ddb.host=127.0.0.1 -Ddb.name=shopware build-unit + - mv ${TRAVIS_BUILD_DIR} ${PLUGIN_DIRECTORY}/${PLUGIN_NAME} + - php ${HOME}/shopware/bin/console sw:plugin:refresh + - php ${HOME}/shopware/bin/console sw:plugin:install ${PLUGIN_NAME} + - php ${HOME}/shopware/bin/console sw:plugin:activate ${PLUGIN_NAME} + - cd ${PLUGIN_DIRECTORY}/${PLUGIN_NAME} + +script: + - composer test + +after_success: + - ./build.sh + +matrix: + allow_failures: + - env: SHOPWARE_VERSION="5.5" + - php: nightly