Browse Source

Change drush installation

Install drush with composer

Split out phpcs

Try to get 5.3.3 working

Clean up symlinks

Use older drush for 5.3.3

Fix script
pull/714/head
Jared Whiklo 7 years ago
parent
commit
9d4d6e58bd
  1. 27
      tests/scripts/travis_scripts.sh
  2. 48
      tests/scripts/travis_setup.sh

27
tests/scripts/travis_scripts.sh

@ -1,15 +1,40 @@
#!/bin/bash #!/bin/bash
# Common checks to get run during the 'script' section in Travis. # Common checks to get run during the 'script' section in Travis.
OUTPUT=0
# Make OUTPUT equal return code if return code is not 0
function checkReturn {
if [ $1 -ne 0 ]; then
OUTPUT=$1
fi
}
# Lint # Lint
find $TRAVIS_BUILD_DIR -type f \( -name '*.php' -o -name '*.inc' -o -name '*.module' -o -name '*.install' -o -name '*.test' \) -exec php -l {} \; find $TRAVIS_BUILD_DIR -type f \( -name '*.php' -o -name '*.inc' -o -name '*.module' -o -name '*.install' -o -name '*.test' \) -exec php -l {} \;
checkReturn $?
# Check line endings # Check line endings
$ISLANDORA_DIR/tests/scripts/line_endings.sh $TRAVIS_BUILD_DIR $ISLANDORA_DIR/tests/scripts/line_endings.sh $TRAVIS_BUILD_DIR
checkReturn $?
# Coding standards # Coding standards
drush coder-review --reviews=production,security,style,i18n,potx,sniffer $TRAVIS_BUILD_DIR drush coder-review --reviews=production,security,style,i18n,potx $TRAVIS_BUILD_DIR
checkReturn $?
# Code sniffer
if [ -d "$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; then
DRUPAL_SNIFFS=$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal
elif [ -d "$HOME/.config/composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; then
DRUPAL_SNIFFS=$HOME/.config/composer/vendor/drupal/coder/coder_sniffer/Drupal
else
DRUPAL_SNIFFS="Drupal"
fi
/usr/bin/phpcs --standard=$DRUPAL_SNIFFS --extensions="php,module,inc" --ignore="*.md" $TRAVIS_BUILD_DIR
checkReturn $?
# Copy/paste detection # Copy/paste detection
phpcpd --names *.module,*.inc,*.test $TRAVIS_BUILD_DIR phpcpd --names *.module,*.inc,*.test $TRAVIS_BUILD_DIR
checkReturn $?
exit $OUTPUT

48
tests/scripts/travis_setup.sh

@ -25,25 +25,43 @@ 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" export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -Djavax.net.ssl.trustStore=$CATALINA_HOME/fedora/server/truststore -Djavax.net.ssl.trustStorePassword=tomcat"
# TODO: roll a Fedora 3.8.1 islandora_tomcat that doesn't require a rebuild. # TODO: roll a Fedora 3.8.1 islandora_tomcat that doesn't require a rebuild.
if [ $FEDORA_VERSION = "3.8.1" ]; then if [ $FEDORA_VERSION = "3.8.1" ]; then
export FEDORA_HOME=fedora export FEDORA_HOME=$HOME/islandora_tomcat/fedora
./fedora/server/bin/fedora-rebuild.sh -r org.fcrepo.server.utilities.rebuild.SQLRebuilder ./fedora/server/bin/fedora-rebuild.sh -r org.fcrepo.server.utilities.rebuild.SQLRebuilder
fi fi
./bin/startup.sh ./bin/startup.sh
# Drush installation.
cd $HOME cd $HOME
pear channel-discover pear.drush.org
pear upgrade --force Console_Getopt
pear upgrade --force pear
pear channel-discover pear.drush.org
wget http://alpha.library.yorku.ca/drush-6.3.tar.gz
tar xf drush-6.3.tar.gz
sudo mv drush-6.3 /opt/
sudo ln -s /opt/drush-6.3/drush /usr/bin/drush
# PHPCS installation. # Drush and PHPCS installation.
wget http://alpha.library.yorku.ca/PHP_CodeSniffer-1.5.6.tgz if [ "$(phpenv version-name)" == "5.3.3" ]; then
pear install PHP_CodeSniffer-1.5.6.tgz # No mod_openssl in Travis 5.3.3 boxes
composer config -g disable-tls true
composer config -g secure-http false
composer self-update
composer global require drush/drush:6.*
composer global require drupal/coder:7.*
else
composer global require drush/drush:7.*
composer global require drupal/coder
fi
# Symlink the things
if [ -f "$HOME/.config/composer/vendor/bin/drush" ]; then
sudo ln -s $HOME/.config/composer/vendor/bin/drush /usr/bin/drush
elif [ -f "$HOME/.composer/vendor/bin/drush" ]; then
sudo ln -s $HOME/.composer/vendor/bin/drush /usr/bin/drush
else
echo "Could not find drush"
exit 1
fi
if [ -f "$HOME/.config/composer/vendor/bin/phpcs" ]; then
sudo ln -s $HOME/.config/composer/vendor/bin/phpcs /usr/bin/phpcs
elif [ -f "$HOME/.composer/vendor/bin/phpcs" ]; then
sudo ln -s $HOME/.composer/vendor/bin/phpcs /usr/bin/phpcs
else
echo "Did not find phpcs"
fi
# PHP Copy-Paste Detection installation. # PHP Copy-Paste Detection installation.
wget http://alpha.library.yorku.ca/phpcpd.phar wget http://alpha.library.yorku.ca/phpcpd.phar
@ -55,7 +73,11 @@ phpenv rehash
drush dl --yes drupal drush dl --yes drupal
cd drupal-* cd drupal-*
drush si minimal --db-url=mysql://drupal:drupal@localhost/drupal --yes drush si minimal --db-url=mysql://drupal:drupal@localhost/drupal --yes
if [ "$(phpenv version-name)" == "5.3.3" ]; then
drush runserver --php-cgi=$HOME/.phpenv/shims/php-cgi localhost:8081 &>/tmp/drush_webserver.log & drush runserver --php-cgi=$HOME/.phpenv/shims/php-cgi localhost:8081 &>/tmp/drush_webserver.log &
else
drush runserver localhost:8081 &>/tmp/drush_webserver.log &
fi
# Add Islandora to the list of symlinked modules. # Add Islandora to the list of symlinked modules.
ln -s $ISLANDORA_DIR sites/all/modules/islandora ln -s $ISLANDORA_DIR sites/all/modules/islandora
# Use our custom Travis test config for Simpletest. # Use our custom Travis test config for Simpletest.

Loading…
Cancel
Save