-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
801 additions
and
0 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 |
---|---|---|
|
@@ -41,3 +41,9 @@ Thumbs.db | |
# SASS # | ||
########## | ||
.sass-cache | ||
|
||
# COMPOSER # | ||
############ | ||
vendor | ||
composer.lock | ||
|
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,28 @@ | ||
language: php | ||
php: | ||
- 5.3 | ||
before_install: | ||
- cp scripts/travis-ci.sh $HOME/ | ||
- chmod +x $HOME/travis-ci.sh | ||
- cp scripts/ssh-config $HOME/.ssh/config | ||
- $HOME/travis-ci.sh before-install | ||
before_script: | ||
- $HOME/travis-ci.sh before-script | ||
script: | ||
- $HOME/travis-ci.sh script | ||
after_script: | ||
- $HOME/travis-ci.sh after-script | ||
after_success: | ||
- $HOME/travis-ci.sh after-success | ||
before_deploy: | ||
- $HOME/travis-ci.sh before-deploy | ||
after_deploy: | ||
- $HOME/travis-ci.sh after-deploy | ||
cache: | ||
directories: | ||
- vendor | ||
notifications: | ||
email: | ||
recipients: | ||
- [email protected] | ||
on_success: always |
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,3 @@ | ||
Host *drush.in | ||
StrictHostKeyChecking no | ||
PreferredAuthentications publickey |
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,145 @@ | ||
#!/bin/bash | ||
|
||
COMMAND=$1 | ||
EXIT_VALUE=0 | ||
|
||
## | ||
# SCRIPT COMMANDS | ||
## | ||
|
||
# before-install | ||
# | ||
# Do some stuff before npm install | ||
# | ||
before-install() { | ||
if [ $TRAVIS_BRANCH == "master" ] && | ||
[ $TRAVIS_PULL_REQUEST == "false" ] && | ||
[ $TRAVIS_REPO_SLUG == "kalamuna/playbox" ]; then | ||
openssl aes-256-cbc -K $encrypted_739d46f84175_key -iv $encrypted_739d46f84175_iv -in ci/travis.id_rsa.enc -out $HOME/.ssh/travis.id_rsa -d | ||
fi | ||
} | ||
|
||
# before-script | ||
# | ||
# Install build dependencies | ||
# | ||
before-script() { | ||
composer update | ||
pear install pear/PHP_CodeSniffer | ||
phpenv rehash | ||
} | ||
|
||
# script | ||
# | ||
# Run the tests. | ||
# | ||
script() { | ||
# Lint check PHP files. | ||
find . -path "*/sites/all/*" \( -type f -name \*.inc -o -name \*.php -o -name \*.module -o -name \*.install \) -print0 | xargs -0 -n 1 -P 4 php -l | ||
# PHP_CodeSniffer using Drupal Coding Standard. | ||
phpcs --standard=./vendor/coder/coder/coder_sniffer/Drupal --ignore=*/panopoly_demo/* sites/all/* | ||
} | ||
|
||
# after-script | ||
# | ||
# Clean up after the tests. | ||
# | ||
after-script() { | ||
echo | ||
} | ||
|
||
# after-success | ||
# | ||
# Deploy | ||
# | ||
after-success() { | ||
if [ $TRAVIS_BRANCH == "master" ] && | ||
[ $TRAVIS_PULL_REQUEST == "false" ] && | ||
[ $TRAVIS_REPO_SLUG == "kalamuna/playbox" ]; then | ||
chmod 600 $HOME/travis.id_rsa | ||
eval "$(ssh-agent)" | ||
ssh-add $HOME/travis.id_rsa | ||
git config --global user.name "Kala C. Bot" | ||
git config --global user.email [email protected] | ||
git remote add upstream ssh://codeserver.dev.f0072597-f475-4513-af94-13a33b630923@codeserver.dev.f0072597-f475-4513-af94-13a33b630923.drush.in:2222/~/repository.git | ||
git add --all | ||
git commit -m "KALABOT BUILDING COMMIT ${TRAVIS_COMMIT} FROM ${TRAVIS_REPO_SLUG}" | ||
git push upstream master -f | ||
fi | ||
} | ||
|
||
# before-deploy | ||
# | ||
# Clean up after the tests. | ||
# | ||
before-deploy() { | ||
echo | ||
} | ||
|
||
# after-deploy | ||
# | ||
# Clean up after the tests. | ||
# | ||
after-deploy() { | ||
echo | ||
} | ||
|
||
## | ||
# UTILITY FUNCTIONS: | ||
## | ||
|
||
# Sets the exit level to error. | ||
set_error() { | ||
EXIT_VALUE=1 | ||
} | ||
|
||
# Runs a command and sets an error if it fails. | ||
run_command() { | ||
set -xv | ||
if ! $@; then | ||
set_error | ||
fi | ||
set +xv | ||
} | ||
|
||
## | ||
# SCRIPT MAIN: | ||
## | ||
|
||
# Capture all errors and set our overall exit value. | ||
trap 'set_error' ERR | ||
|
||
# We want to always start from the same directory: | ||
cd $TRAVIS_BUILD_DIR | ||
|
||
case $COMMAND in | ||
before-install) | ||
run_command before-install | ||
;; | ||
|
||
before-script) | ||
run_command before-script | ||
;; | ||
|
||
script) | ||
run_command script | ||
;; | ||
|
||
after-script) | ||
run_command after-script | ||
;; | ||
|
||
after-success) | ||
run_command after-success | ||
;; | ||
|
||
before-deploy) | ||
run_command before-deploy | ||
;; | ||
|
||
after-deploy) | ||
run_command after-deploy | ||
;; | ||
esac | ||
|
||
exit $EXIT_VALUE |
Binary file not shown.
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,26 @@ | ||
{ | ||
"name": "kalamuna/playbox", | ||
"description": "CI/CD dependencies for play.kalabox.com", | ||
"homepage": "http://play.kalamuna.com", | ||
"license": "MIT", | ||
"authors": [{ | ||
"name": "Jon Peck" | ||
}], | ||
"repositories": [{ | ||
"type": "package", | ||
"package": { | ||
"name": "coder/coder", | ||
"version": "2.2", | ||
"dist": { | ||
"url": "http://ftp.drupal.org/files/projects/coder-7.x-2.2.zip", | ||
"type": "zip" | ||
} | ||
} | ||
}], | ||
"require": { | ||
"php": ">=5.3.3" | ||
}, | ||
"require-dev": { | ||
"coder/coder": "2.2" | ||
} | ||
} |
Oops, something went wrong.