-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from mothership-gmbh/develop
Develop
- Loading branch information
Showing
17 changed files
with
713 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
language: php | ||
sudo: true | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
# - 5.6 | ||
- 7.0 | ||
|
||
env: | ||
matrix: | ||
- MAGENTO_VERSION="magento-mirror-1.6.2.0" INSTALL_SAMPLE_DATA=yes | ||
- MAGENTO_VERSION="magento-mirror-1.7.0.2" INSTALL_SAMPLE_DATA=yes | ||
- MAGENTO_VERSION="magento-mirror-1.8.1.0" INSTALL_SAMPLE_DATA=yes | ||
# Do not download sample data of 1.9 -> The file is too big | ||
- MAGENTO_VERSION="magento-mirror-1.9.0.1" INSTALL_SAMPLE_DATA=no | ||
- MAGENTO_VERSION="magento-mirror-1.9.1.1" INSTALL_SAMPLE_DATA=no | ||
- MAGENTO_VERSION="magento-mirror-1.9.2.1" INSTALL_SAMPLE_DATA=no | ||
- MAGENTO_VERSION="magento-mirror-1.9.2.2" INSTALL_SAMPLE_DATA=no | ||
- MAGENTO_VERSION="magento-mirror-1.9.2.3" INSTALL_SAMPLE_DATA=no | ||
|
||
## Update composer and run the appropriate composer command | ||
before_script: | ||
- composer install | ||
#install modman | ||
#- sudo wget http://module-manager.googlecode.com/files/modman-1.1.1 | ||
#- sudo cp modman-1.1.1 /usr/local/bin/modman | ||
#- sudo chmod +x /usr/local/bin/modman #needs to be executable | ||
#- cd "${MAGENTO_VERSION}" | ||
#- modman init | ||
#- modman deploy-all | ||
- composer self-update -q | ||
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; | ||
|
||
before_install: | ||
- chmod +x _deploy/travis.sh | ||
|
||
allow_failures: | ||
- php: 5.4 | ||
- php: hhvm | ||
- env: MAGENTO_VERSION="magento-mirror-1.8.1.0" INSTALL_SAMPLE_DATA=yes | ||
- env: MAGENTO_VERSION="magento-mirror-1.9.2.3" INSTALL_SAMPLE_DATA=yes | ||
|
||
env: | ||
- MAGENTO_VERSION="magento-mirror-1.8.1.0" INSTALL_SAMPLE_DATA=no | ||
- MAGENTO_VERSION="magento-mirror-1.9.2.3" INSTALL_SAMPLE_DATA=no | ||
|
||
#script: | ||
# - phpunit --coverage-text | ||
script: _deploy/travis.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
htdocs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
function cleanup { | ||
if [ -z $SKIP_CLEANUP ]; then | ||
echo "Removing build directory ${BUILDENV}" | ||
#rm -rf "${BUILDENV}" | ||
fi | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
BUILDENV="/srv/extension.vm"; | ||
|
||
MAGENTO_DB_HOST="127.0.0.1"; | ||
MAGENTO_DB_PORT="3306"; | ||
MAGENTO_DB_USER="super"; | ||
MAGENTO_DB_PASS="super123"; | ||
MAGENTO_DB_NAME="extension"; | ||
MAGENTO_DB_ALLOWSAME="0"; | ||
|
||
CWD=$(pwd) | ||
|
||
|
||
# Use the local mothership patched one | ||
MAGENTO_VERSION=magento-mirror-1.8.1.0 | ||
|
||
# | ||
if [ -d "${BUILDENV}/htdocs" ] ; then | ||
rm -rf ${BUILDENV}/htdocs | ||
fi | ||
|
||
mkdir -p ${BUILDENV}/htdocs | ||
|
||
|
||
echo "Using build directory ${BUILDENV}" | ||
|
||
|
||
|
||
if [ -d "${BUILDENV}/.modman/extension" ] ; then | ||
rm -rf "${BUILDENV}/.modman/extension" | ||
fi | ||
|
||
mkdir -p ${BUILDENV}/.modman/extension | ||
|
||
cp -rf . "${BUILDENV}/.modman/extension" | ||
|
||
# Start building everything | ||
cp -f ${CWD}/composer.json ${BUILDENV} | ||
cp -f ${CWD}/_deploy/.basedir ${BUILDENV}/.modman | ||
|
||
# Get absolute path to main directory | ||
ABSPATH=$(cd "${0%/*}" 2>/dev/null; echo "${PWD}/${0##*/}") | ||
SOURCE_DIR=`dirname "${ABSPATH}"` | ||
|
||
echo ${SOURCE_DIR} | ||
|
||
echo | ||
echo "-------------------------------" | ||
echo "- Mothership local deployment -" | ||
echo "-------------------------------" | ||
echo | ||
|
||
cd /tmp | ||
|
||
mysql -u${MAGENTO_DB_USER} -p${MAGENTO_DB_PASS} -h${MAGENTO_DB_HOST} -P${MAGENTO_DB_PORT} -e "DROP DATABASE IF EXISTS \`${MAGENTO_DB_NAME}\`; CREATE DATABASE \`${MAGENTO_DB_NAME}\`;" | ||
|
||
# Install Magento with sample data | ||
magerun install \ | ||
--dbHost="${MAGENTO_DB_HOST}" --dbUser="${MAGENTO_DB_USER}" --dbPass="${MAGENTO_DB_PASS}" --dbName="${MAGENTO_DB_NAME}" --dbPort="${MAGENTO_DB_PORT}" \ | ||
--installSampleData=yes \ | ||
--useDefaultConfigParams=yes \ | ||
--magentoVersionByName="${MAGENTO_VERSION}" \ | ||
--installationFolder="${BUILDENV}/htdocs" \ | ||
--baseUrl="http://extension.vm/" || { echo "Installing Magento failed"; exit 1; } | ||
|
||
|
||
cd ${BUILDENV} | ||
|
||
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php | ||
php composer-setup.php | ||
|
||
php composer.phar install | ||
modman deploy-all --force | ||
|
||
# After running composer, we will have all the files needed. Now | ||
#cp ${CWD}/phpunit.xml.dist "${BUILDENV}/htdocs/phpunit.xml.dist" | ||
|
||
magerun cache:clean | ||
magerun sys:module:list |grep Mothership | ||
|
||
export N98_MAGERUN_TEST_MAGENTO_ROOT=${BUILDENV}/htdocs | ||
|
||
cd ${BUILDENV}/htdocs | ||
phpunit --group Mothership --debug --verbose | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
|
||
BUILDENV="/srv/extension.vm"; | ||
|
||
cp -f composer.json ${BUILDENV} | ||
cp -f _deploy/.basedir ${BUILDENV}/.modman | ||
|
||
if [ -d "${BUILDENV}/.modman/extension" ] ; then | ||
rm -rf "${BUILDENV}/.modman/extension" | ||
fi | ||
|
||
cp -rf . "${BUILDENV}/.modman/extension" | ||
|
||
cd ${BUILDENV} | ||
php composer.phar install | ||
modman deploy-all --force | ||
|
||
magerun cache:clean | ||
magerun sys:module:list |grep Mothership | ||
export N98_MAGERUN_TEST_MAGENTO_ROOT=${BUILDENV}/htdocs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
# most of the script is based on the fantastic https://github.com/AOEpeople/MageTestStand project | ||
|
||
# create a temporary directory | ||
BUILDENV=`mktemp -d /tmp/mothership.XXXXXXXX` | ||
CWD=$(pwd) | ||
|
||
echo "BUILD = ${BUILDENV}" | ||
echo "CWD = ${CWD}" | ||
|
||
|
||
mkdir -p ${BUILDENV}/.modman/mothership_magerun | ||
|
||
cp -rf . "${BUILDENV}/.modman/mothership_magerun" | ||
|
||
# Start building everything | ||
cp -f ${CWD}/composer.json ${BUILDENV} | ||
cp -f ${CWD}/_deploy/.basedir ${BUILDENV}/.modman | ||
|
||
# Get absolute path to main directory | ||
ABSPATH=$(cd "${0%/*}" 2>/dev/null; echo "${PWD}/${0##*/}") | ||
SOURCE_DIR=`dirname "${ABSPATH}"` | ||
|
||
if [ -z $MAGENTO_DB_HOST ]; then MAGENTO_DB_HOST="localhost"; fi | ||
if [ -z $MAGENTO_DB_PORT ]; then MAGENTO_DB_PORT="3306"; fi | ||
if [ -z $MAGENTO_DB_USER ]; then MAGENTO_DB_USER="root"; fi | ||
if [ -z $MAGENTO_DB_PASS ]; then MAGENTO_DB_PASS=""; fi | ||
if [ -z $MAGENTO_DB_NAME ]; then MAGENTO_DB_NAME="mageteststand"; fi | ||
if [ -z $MAGENTO_DB_ALLOWSAME ]; then MAGENTO_DB_ALLOWSAME="0"; fi | ||
|
||
echo | ||
echo "---------------------" | ||
echo "- Mothership local -" | ||
echo "---------------------" | ||
echo | ||
echo "Installing ${MAGENTO_VERSION} in ${SOURCE_DIR}/htdocs" | ||
echo "using Database Credentials:" | ||
echo " Host: ${MAGENTO_DB_HOST}" | ||
echo " Port: ${MAGENTO_DB_PORT}" | ||
echo " User: ${MAGENTO_DB_USER}" | ||
echo " Pass: [hidden]" | ||
echo " Main DB: ${MAGENTO_DB_NAME}" | ||
echo " Test DB: ${MAGENTO_DB_NAME}_test" | ||
echo " Allow same db: ${MAGENTO_DB_ALLOWSAME}" | ||
echo | ||
|
||
|
||
|
||
|
||
cd ${BUILDENV} | ||
|
||
# Download composer | ||
composer self-update | ||
bash < <(curl -s -L https://raw.github.com/colinmollenhour/modman/master/modman-installer) | ||
|
||
cd ${BUILDENV} | ||
wget http://files.magerun.net/n98-magerun-latest.phar | ||
chmod +x ./n98-magerun-latest.phar | ||
|
||
|
||
if [ ! -f htdocs/app/etc/local.xml ] ; then | ||
|
||
# Create main database | ||
MYSQLPASS="" | ||
if [ ! -z $MAGENTO_DB_PASS ]; then MYSQLPASS="-p${MAGENTO_DB_PASS}"; fi | ||
mysql -u${MAGENTO_DB_USER} ${MYSQLPASS} -h${MAGENTO_DB_HOST} -P${MAGENTO_DB_PORT} -e "DROP DATABASE IF EXISTS \`${MAGENTO_DB_NAME}\`; CREATE DATABASE \`${MAGENTO_DB_NAME}\`;" | ||
|
||
./n98-magerun-latest.phar install \ | ||
--dbHost="${MAGENTO_DB_HOST}" --dbUser="${MAGENTO_DB_USER}" --dbPass="${MAGENTO_DB_PASS}" --dbName="${MAGENTO_DB_NAME}" --dbPort="${MAGENTO_DB_PORT}" \ | ||
--installSampleData=yes \ | ||
--useDefaultConfigParams=yes \ | ||
--magentoVersionByName="${MAGENTO_VERSION}" \ | ||
--installationFolder="${BUILDENV}/htdocs" \ | ||
--baseUrl="http://magento.local/" || { echo "Installing Magento failed"; exit 1; } | ||
fi | ||
|
||
# run composer update and install all requirements | ||
composer self-update | ||
composer install | ||
|
||
# run modman and first debug | ||
ls -lisah ${BUILDENV} | ||
modman deploy-all --force | ||
|
||
./n98-magerun-latest.phar --root-dir=htdocs config:set dev/template/allow_symlink 1 | ||
./n98-magerun-latest.phar --root-dir=htdocs sys:setup:run | ||
./n98-magerun-latest.phar --root-dir=htdocs cache:flush | ||
|
||
./n98-magerun-latest.phar cache:clean | ||
./n98-magerun-latest.phar sys:module:list | ||
export N98_MAGERUN_TEST_MAGENTO_ROOT=${BUILDENV}/htdocs | ||
|
||
|
||
cd ${BUILDENV}/htdocs | ||
ls -lisah ${BUILDENV}/htdocs | ||
|
||
ls -lisah ${BUILDENV}/vendor/ | ||
cat ${BUILDENV}/vendor/autoload.php | ||
cat ${BUILDENV}/vendor/composer/autoload_psr4.php | ||
|
||
../vendor/phpunit/phpunit/phpunit --verbose --debug --config=phpunit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
src/lib/n98-magerun/modules/mothership_addons lib/n98-magerun/modules/mothership_addons | ||
src/app/etc/mothership/environments/environment_vm.php.example app/etc/mothership/environments/environment_vm.php.example | ||
|
||
src/app/etc/mothership/workflows/Example.yaml app/etc/mothership/workflows/Example.yaml | ||
|
||
src/app/etc/modules/Mothership_Addons.xml app/etc/modules/Mothership_Addons.xml | ||
src/app/code/local/Mothership/Addons app/code/local/Mothership/Addons | ||
|
||
src/media/feeds/readme.md media/feeds/readme.md | ||
src/lib/Mothership/Magerun lib/Mothership/Magerun | ||
|
||
src/shell/queue.php shell/queue.php | ||
src/shell/queue.php shell/queue.php | ||
|
||
tests tests | ||
phpunit.xml.dist phpunit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<phpunit backupGlobals="true" | ||
bootstrap="tests/bootstrap.php" | ||
backupStaticAttributes="false" | ||
cacheTokens="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
forceCoversAnnotation="false" | ||
mapTestClassNameToCoveredClassName="false" | ||
processIsolation="false" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false"> | ||
<testsuites> | ||
<testsuite name="n98-magerun-tests"> | ||
<directory>./tests</directory> | ||
<exclude>tests/N98/Magento/Command/Installer/UninstallCommandTest.php</exclude> | ||
</testsuite> | ||
<testsuite name="n98-magerun-magento-uninstall-tests"> | ||
<file>./tests/N98/Magento/Command/Installer/UninstallCommandTest.php</file> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist addUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src</directory> | ||
<exclude> | ||
<file>tests/bootstrap.php</file> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.