#!/bin/sh set -e COMPOSER_PHAR="/root/.composer/composer.phar" WORKDIR="/tmp/app" # Copy project to isolated working directory rm -rf "$WORKDIR" cp -r /app "$WORKDIR" cd "$WORKDIR" # Remove lock file and vendor for fresh install rm -f composer.lock rm -rf vendor/ # Download Composer if not cached if [ ! -f "$COMPOSER_PHAR" ]; then echo "Downloading Composer..." mkdir -p /root/.composer curl -sS https://getcomposer.org/installer | php -- --install-dir=/root/.composer --filename=composer.phar fi # Install dependencies echo "COMPOSER_FLAGS: ${COMPOSER_FLAGS:-}" php "$COMPOSER_PHAR" update --no-interaction ${COMPOSER_FLAGS:-} # Run tests php "$COMPOSER_PHAR" test