diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..f3a6a27be --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +sudo: false + +language: php +php: 7.1 + +env: + global: + - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH" + +before_install: + - | + # Remove Xdebug for a huge performance increase: + if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then + phpenv config-rm xdebug.ini + else + echo "xdebug.ini does not exist" + fi + +install: + - composer install --no-interaction + +before_script: + - composer validate + - ./ci/prepare.sh + +jobs: + include: + - stage: deploy + env: DEPLOY_BRANCH=release/v4 + script: ./ci/deploy.sh + +cache: + directories: + - $HOME/.composer/cache + +branches: + only: + - develop-v4 + - release/v4 + +notifications: + email: + on_success: never + on_failure: change \ No newline at end of file diff --git a/ci/deploy.sh b/ci/deploy.sh new file mode 100755 index 000000000..1877ddc15 --- /dev/null +++ b/ci/deploy.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# called by Travis CI + +if [[ "false" != "$TRAVIS_PULL_REQUEST" ]]; then + echo "Not deploying pull requests." + exit +fi + +if [ -z $DEPLOY_BRANCH ]; then + echo "Skipping deployment as DEPLOY_BRANCH is not set" + exit +fi + +if [[ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]] && [[ ! "$TRAVIS_BRANCH" == "develop-v4" ]]; then + echo "Skipping deployment as '$TRAVIS_BRANCH' is not a deploy branch." + exit +fi + +# Turn off command traces while dealing with the private key +set +x + +# Get the encrypted private key from the repo settings +echo $EE_REPO_DEPLOY_KEY | base64 --decode > ~/.ssh/id_rsa +chmod 600 ~/.ssh/id_rsa + +# anyone can read the build log, so it MUST NOT contain any sensitive data +set -x + +# add github's public key +echo "|1|qPmmP7LVZ7Qbpk7AylmkfR0FApQ=|WUy1WS3F4qcr3R5Sc728778goPw= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts + +git clone git@github.com:easyengine/easyengine-builds.git + +git config user.name "Travis CI" +git config user.email "travis@travis-ci.org" +git config push.default "current" + +if [[ "$TRAVIS_BRANCH" == "develop-v4" ]]; then + fname="phar/easyengine-nightly.phar" +else + fname="phar/easyengine.phar" +fi + +mv $fname easyengine-builds/$fname +cd easyengine-builds +chmod -x $fname + +md5sum $fname | cut -d ' ' -f 1 > $fname.md5 +sha512sum $fname | cut -d ' ' -f 1 > $fname.sha512 + +git add . +git commit -m "phar build: $TRAVIS_REPO_SLUG@$TRAVIS_COMMIT" + +git push \ No newline at end of file diff --git a/ci/prepare.sh b/ci/prepare.sh new file mode 100755 index 000000000..bd6cd82f8 --- /dev/null +++ b/ci/prepare.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# called by Travis CI + +php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null +php easyengine.phar cli version \ No newline at end of file diff --git a/composer.lock b/composer.lock index 91b8413cb..4a2d1d27d 100644 --- a/composer.lock +++ b/composer.lock @@ -268,12 +268,12 @@ "source": { "type": "git", "url": "https://github.com/EasyEngine/site-command.git", - "reference": "85f913a404d336082e25cc06c79990143134ae89" + "reference": "f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/85f913a404d336082e25cc06c79990143134ae89", - "reference": "85f913a404d336082e25cc06c79990143134ae89", + "url": "https://api.github.com/repos/EasyEngine/site-command/zipball/f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4", + "reference": "f62bd63b04bfe89de794cc08d2d63e6b8a4a48c4", "shasum": "" }, "type": "ee-cli-package", @@ -302,7 +302,7 @@ "MIT" ], "homepage": "https://github.com/easyengine/site-command", - "time": "2018-04-06T15:50:47+00:00" + "time": "2018-04-09T11:25:52+00:00" }, { "name": "easyengine/wp-command",