Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
55 changes: 55 additions & 0 deletions ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions ci/prepare.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.