Skip to content

Commit

Permalink
Add travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpoensgen committed Feb 11, 2019
1 parent 846f834 commit a26d156
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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}
13 changes: 13 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
51 changes: 51 additions & 0 deletions travis.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a26d156

Please sign in to comment.