diff --git a/.gitignore b/.gitignore index d25442b..3b57ca7 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ tests/coverage /.ezlaunchpad.yml # Travis stuff +/.travis/build-key.pem /.travis/ezlaunchpad-private.pem /.travis/secrets.tar diff --git a/.travis.yml b/.travis.yml index 2ef8277..0046c88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ sudo: false - language: php cache: @@ -10,16 +9,16 @@ cache: matrix: fast_finish: true include: - - php: 5.5 - php: 5.6 env: - EXECUTE_DEPLOYMENT=true - php: 7 - php: 7.1 - allow_failures: - - php: 5.5 + before_install: +- openssl aes-256-cbc -K $encrypted_91e9470aafb9_key -iv $encrypted_91e9470aafb9_iv -in .travis/secrets.tar.enc -out .travis/secrets.tar -d +- phpenv config-rm xdebug.ini - composer self-update install: @@ -28,8 +27,9 @@ install: script: - php vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php src/ -#- php vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php tests/Tests/ -#- php vendor/behat/behat/bin/behat +- php vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php tests/Tests/ +- php vendor/bin/phpunit -c tests/ --exclude-group behat +- php vendor/behat/behat/bin/behat -c tests/behat.yml after_success: - if [[ $EXECUTE_DEPLOYMENT == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then composer install --no-dev ; fi diff --git a/.travis/secrets.tar.enc b/.travis/secrets.tar.enc new file mode 100644 index 0000000..e844383 Binary files /dev/null and b/.travis/secrets.tar.enc differ diff --git a/scripts/codechecker.bash b/scripts/codechecker.bash index 7255eb2..d512f73 100644 --- a/scripts/codechecker.bash +++ b/scripts/codechecker.bash @@ -16,14 +16,14 @@ cd ${PROJECTDIR} echoTitle "******** Mess Detector ********" $PHP ./vendor/bin/phpmd $SRC text .cs/md_ruleset.xml -#$PHP ./vendor/bin/phpmd tests/Tests text .cs/md_ruleset.xml +$PHP ./vendor/bin/phpmd tests/Tests text .cs/md_ruleset.xml echoTitle "******** CodeFixer ************" $PHP ./vendor/bin/php-cs-fixer fix --config=.cs/.php_cs.php echoTitle "******** CodeSniffer **********" $PHP ./vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php $SRC -#$PHP ./vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php tests/Tests +$PHP ./vendor/bin/phpcs --standard=.cs/cs_ruleset.xml --extensions=php tests/Tests echoSuccess "Done." exit 0; diff --git a/scripts/travis_deploy.bash b/scripts/travis_deploy.bash index d612838..712baee 100755 --- a/scripts/travis_deploy.bash +++ b/scripts/travis_deploy.bash @@ -5,16 +5,18 @@ tar xvf .travis/secrets.tar -C .travis # Setup SSH agent: eval "$(ssh-agent -s)" #start the ssh agent -chmod 600 .travis/ezlaunchpad-private.pem -ssh-add .travis/ezlaunchpad-private.pem +chmod 600 .travis/build-key.pem +ssh-add .travis/build-key.pem # Setup git defaults: -git config --global user.email "ezlaunchpad@ez.no" -git config --global user.name "eZ Launchpad" +git config --global user.email "github-ezlaunchpad@ez.no" +git config --global user.name "eZ Launchpad Github Bot" # Add SSH-based remote to GitHub repo: git remote add deploy git@github.com:ezsystems/ezlaunchpad.git git fetch deploy +git checkout master +git status # Get box and build PHAR curl -LSs https://box-project.github.io/box2/installer.php | php @@ -30,5 +32,5 @@ git add docs/ez.phar docs/ez.phar.version # Commit and push: DATED_SUFFIX=`date +%Y-%m-%d-%H-%M-%S` -git commit -m "Deployment master on $DATED_SUFFIX" +git commit -m "[skip ci] Deployment new eZ Launchpad on $DATED_SUFFIX" git push deploy master diff --git a/tests/Tests/RequiredFilesTest.php b/tests/Tests/RequiredFilesTest.php index 66c36fc..85f17cf 100644 --- a/tests/Tests/RequiredFilesTest.php +++ b/tests/Tests/RequiredFilesTest.php @@ -16,6 +16,7 @@ class RequiredBoxFilesTest extends TestCase { const FILE = "assertFileExists"; + const DIRECTORY = "assertDirectoryExists"; /** @@ -34,7 +35,7 @@ public function getRequiredFiles() } $data[] = [$box->main, static::FILE]; - $data[] = [$box->key, static::FILE]; + $data[] = [".travis/secrets.tar", static::FILE]; return $data; } @@ -55,5 +56,4 @@ public function testBoxFileIsPresent($file, $type) $appDir = __DIR__."/../.."; $this->$type("{$appDir}/{$file}"); } - }