Browse Source

fix travis logging

pull/518/head
qadan 10 years ago
parent
commit
44b92b4b2b
  1. 2
      .travis.yml
  2. 65
      tests/scripts/README.md
  3. 26
      tests/scripts/travis_after_failure.sh
  4. 13
      tests/scripts/travis_setup.sh

2
.travis.yml

@ -13,7 +13,7 @@ env:
global:
# This key is unique to the Islandora/islandora repository; logging will
# fail on forked repositories unless a new unique key is generated for them.
- secure: "nTv2Zb/qKlECK+xE5ahbfXI9ZZbf2ZMd796q7oPlTxUwvu6nomHnUOjJATl6tq2cj23PyJ89Jlgl5cMZ5h0QMUzYpN5hPyY6oCJxWgFamFaE3bv5E/rBd1f6WVTJW7S4UKn8Mr9R2PrX+ZxQZGVIigAfR8VfhQuP8PcuO5eMLBk="
- secure: "jvq6Q0Pybo+secZ2mAaxuzwUSSUeEyoRQSxvCynkIkx0eQTEGrBek0RMTZKzojSGzARoloczZ2G/ApWku27l9m8DcNaULG7KXqpjHlFy3ryn/zuJJW0P4WvlpICbUkwSXjei47/VTuJBGTm1hoYYmjX81btX3bWsqlJ5cbEivmg="
before_install:
- export ISLANDORA_DIR=$TRAVIS_BUILD_DIR
- $TRAVIS_BUILD_DIR/tests/scripts/travis_setup.sh

65
tests/scripts/README.md

@ -0,0 +1,65 @@
USING THE TRAVIS AFTER-FAILURE SCRIPT
*************************************
The Travis after-failure script dumps several files to per-repository branches
on https://github.com/Islandora/islandora_travis_logs if one of the Travis
builds fails. Most of this process is automated, but it still requires some
work to implement in a repository:
- An encrypted global variable in .travis.yml representing the password of the
islandora-logger Github user.
- A line to run travis_after_failure.sh in the after-failure section of
.travis.yml.
- A new branch of islandora_travis_logger, using the repository name.
THE ENCRYPTED GLOBAL VARIABLE
*****************************
Encrypted global variables can be generated using the travis ruby gem. To find
the appropriate encryption key for your repository, run the following:
```bash
sudo gem install travis # Assuming travis isn't installed
travis encrypt -r account/repository LOGGER_PW=islandora-logger-password
```
Where:
- `account/repository` represents the repository slug, e.g. Islandora/islandora.
- `islandora-logger-password` represents the password for the islandora-logger
account, in plaintext.
The output of this will be a string of encrypted data in quotes, preceded by the
word 'secure', looking something like:
```
secure: ".... a giant string of encrypted data ...."
```
Paste this line into .travis.yml's `env/global` section, so that it looks like:
```
env:
matrix:
- MATRIX_VARIABLES="GO_HERE"
global:
- secure: ".... a giant string of encrypted data ...."
```
THE LINE TO RUN THE AFTER-FAILURE SCRIPT
****************************************
At the end of your .travis.yml, after the `script` section, add the following:
```
after-failure:
- $ISLANDORA_DIR/tests/scripts/travis_after_failure.sh
# Where $ISLANDORA_DIR represents the path to the Islandora module; this has
# likely already been set in before_install in order to run travis_setup.sh
```
THE NEW ISLANDORA_TRAVIS_LOGS BRANCH
************************************
Really very simple ... just add a new branch to
git://github.com/Islandora/islandora_travis_logs/ with your repository name.

26
tests/scripts/travis_after_failure.sh

@ -4,19 +4,27 @@
IFS=/ read -a DELIMITED_SLUG <<< "$TRAVIS_REPO_SLUG"
export CURRENT_REPO=${DELIMITED_SLUG[1]}
git config user.name --global islandora-logger
git config user.email --global noreply@islandora.ca
git config --global user.name islandora-logger
git config --global user.email noreply@islandora.ca
# Git business
export VERBOSE_DIR = $HOME/sites/default/files/simpletest/verbose
cd $HOME
git clone https://islandora-logger:$LOGGER_PW@github.com/Islandora/islandora_travis_logs.git
cd $HOME/drupal-*
export VERBOSE_DIR=`pwd`/sites/default/files/simpletest/verbose
git clone -b $CURRENT_REPO https://islandora-logger:$LOGGER_PW@github.com/Islandora/islandora_travis_logs.git
cd islandora_travis_logs
git checkout -B $CURRENT_REPO
# Out with the old, in with the new
git rm $HOME/islandora_travis_logs/*.*
cp $VERBOSE_DIR/*.* $HOME/islandora_travis_logs
# Out with the old (anything older than a week)
#for i in `find ./ -maxdepth 1 -type d -mtime +7 -print`
#do
# rm -rf $i
#done
# In with the new
#mkdir $TRAVIS_JOB_NUMBER
rm -rf ./*
cp $VERBOSE_DIR/* ./
cp $HOME/islandora_tomcat/logs/* ./
cp /tmp/drush_webserver.log ./
git add -A
git commit -m "Job: $TRAVIS_JOB_NUMBER Commit: $TRAVIS_COMMIT"
git push origin $CURRENT_REPO
git push origin $CURRENT_REPO --quiet

13
tests/scripts/travis_setup.sh

@ -8,6 +8,7 @@ cd $HOME
git clone git://github.com/Islandora/tuque.git
git clone -b $FEDORA_VERSION git://github.com/Islandora/islandora_tomcat.git
cd islandora_tomcat
git fsck
export CATALINA_HOME='.'
export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -Djavax.net.ssl.trustStore=$CATALINA_HOME/fedora/server/truststore -Djavax.net.ssl.trustStorePassword=tomcat"
./bin/startup.sh
@ -18,11 +19,19 @@ pear upgrade --force pear
pear channel-discover pear.drush.org
# "prefer-source" required due to SSL shenanigans on the Travis boxes...
composer global require --prefer-source 'squizlabs/php_codesniffer=*' 'sebastian/phpcpd=*' 'drush/drush:6.3.0'
composer global require --prefer-source 'squizlabs/php_codesniffer=*' 'sebastian/phpcpd=*'
# Because we can't add to the PATH here and this file is used in many repos,
# let's just throw symlinks in.
find $HOME/.composer/vendor/bin -executable \! -type d -exec sudo ln -s {} /usr/local/sbin/ \;
# Install Drush
git clone https://github.com/drush-ops/drush.git
pushd drush
git checkout 5.9.0
chmod +x drush
popd
sudo ln -s $HOME/drush/drush /usr/local/sbin
phpenv rehash
drush dl --yes drupal
cd drupal-*
@ -31,7 +40,7 @@ drush si minimal --db-url=mysql://drupal:drupal@localhost/drupal --yes
sudo chmod a+w sites/default/settings.php
echo "include_once '$HOME/.composer/vendor/autoload.php';" >> sites/default/settings.php
sudo chmod a-w sites/default/settings.php
drush runserver --php-cgi=$HOME/.phpenv/shims/php-cgi localhost:8081 &>/dev/null &
drush runserver --php-cgi=$HOME/.phpenv/shims/php-cgi localhost:8081 &>/tmp/drush_webserver.log &
ln -s $ISLANDORA_DIR sites/all/modules/islandora
mv sites/all/modules/islandora/tests/travis.test_config.ini sites/all/modules/islandora/tests/test_config.ini
mkdir sites/all/libraries

Loading…
Cancel
Save