Reputation: 29326
In my .travis.yml
script I have the following:
before_install:
- cd $HOME
- git clone -b 7.x git://github.com/Islandora/islandora.git
- sh adore-djakota-install.sh
Among some other things. That script referenced there looks like this:
# Download, install and configure adore-djatoka
cd /opt
wget http://sourceforge.net/projects/djatoka/files/djatoka/1.1/adore-djatoka-1.1.tar.gz/download
mv download adore-djatoka-1.1.tar.gz
tar xf adore-djatoka-1.1.tar.gz && rm -rf adore-djatoka-1.1.tar.gz
ln -s adore-djatoka-1.1 adore-djatoka
cp adore-djatoka/dist/adore-djatoka.war $CATALINA_HOME/webapps
echo -e '#!/bin/sh\n# setup environment variables for shell script\nCURRENTDIR=$PWD\n# Define DJATOKA_HOME dynamically\nLAUNCHDIR=/opt/adore-djatoka/bin\n#cd ..\nDJATOKA_HOME=/opt/adore-djatoka\nLIBPATH=$DJATOKA_HOME/lib\n\nif [ `uname` = 'Linux' ] ; then\n if [ `uname -m` = "x86_64" ] ; then\n # Assume Linux AMD 64 has 64-bit Java\n PLATFORM="Linux-x86-64"\n LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"\n export LD_LIBRARY_PATH\n KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"\n else\n # 32-bit Java\n PLATFORM="Linux-x86-32"\n LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"\n export LD_LIBRARY_PATH\n KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"\n fi\nelif [ `uname` = 'Darwin' ] ; then\n # Mac OS X\n PLATFORM="Mac-x86"\n export PATH="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin:$PATH"\n export DYLD_LIBRARY_PATH="$LIBPATH/$PLATFORM"\n KAKADU_LIBRARY_PATH="-DDYLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"\nelif [ `uname` = 'SunOS' ] ; then\n if [ `uname -p` = "i386" ] ; then\n # Assume Solaris x86\n PLATFORM="Solaris-x86"\n LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"\n export LD_LIBRARY_PATH\n else\n # Sparcv9\n PLATFORM="Solaris-Sparcv9"\n LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"\n export LD_LIBRARY_PATH\n fi\nelse\n echo "djatoka env: Unsupported platform: `uname`"\n exit\nfi\n\nKAKADU_HOME=$DJATOKA_HOME/bin/$PLATFORM\n#export KAKADU_HOME\n#cd $LAUNCHDIR\n#for line in `ls -1 $LIBPATH | grep '.jar'`\n# do\n# classpath="$classpath:$LIBPATH/$line"\n#done\n#DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"\n#CLASSPATH=.:../build/:$classpath\nJAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dkakadu.home=$KAKADU_HOME -Djava.library.path=$LIBPATH/$PLATFORM $KAKADU_LIBRARY_PATH"\n\n# If a proxy server is used in your institution... uncomment and set the following:\n#proxySet=true\n#proxyPort=8080\n#proxyHost=proxyout.lanl.gov\n#JAVA_OPTS="$JAVA_OPTS -DproxySet=$proxySet -DproxyPort=$proxyPort -DproxyHost=$proxyHost"' > /opt/adore-djatoka/bin/env.sh
echo -e '#!/bin/sh\n\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the "License"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an "AS IS" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# -----------------------------------------------------------------------------\n# Start Script for the CATALINA Server\n#\n# $Id: startup.sh 562770 2007-08-04 22:13:58Z markt $\n# -----------------------------------------------------------------------------\n\n# Better OS/400 detection: see Bugzilla 31132\nos400=false\ndarwin=false\ncase "`uname`" in\nCYGWIN*) cygwin=true;;\nOS400*) os400=true;;\nDarwin*) darwin=true;;\nesac\n\n# resolve links - $0 may be a softlink\nPRG="$0"\n\nwhile [ -h "$PRG" ] ; do\n ls=`ls -ld "$PRG"`\n link=`expr "$ls" : \0047.*-> \(.*\)$\0047`\n if expr "$link" : \0047/.*\0047 > /dev/null; then\n PRG="$link"\n else\n PRG=`dirname "$PRG"`/"$link"\n fi\ndone\n \nPRGDIR=`dirname "$PRG"`\nEXECUTABLE=catalina.sh\n\n# Check that target executable exists\nif $os400; then\n # -x will Only work on the os400 if the files are: \n # 1. owned by the user\n # 2. owned by the PRIMARY group of the user\n # this will not work if the user belongs in secondary groups\n eval\nelse\n if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then\n echo "Cannot find $PRGDIR/$EXECUTABLE"\n echo "This file is needed to run this program"\n exit 1\n fi\nfi \n\n. /opt/adore-djatoka/bin/env.sh\nexport JAVA_OPTS\nexport FEDORA_HOME=/usr/local/fedora\nexport DJATOKA_HOME=/usr/opt/adore-djatoka\nexport KAKADU_HOME=$DJATOKA_HOME/bin/Linux-x86-64\nexport CATALINA_HOME=$FEDORA_HOME/tomcat\nexport PATH=$FEDORA_HOME/server/bin:$FEDORA_HOME/client/bin:$JAVA_HOME/bin:$CATALINA_HOME/bin:$KAKADU_HOME:$PATH\nexport LD_LIBRARY_PATH=$DJATOKA_HOME/lib/Linux-x86-64:$LD_LIBRARY_PATH\nexport SOLR_HOME=$FEDORA_HOME/solr\n\necho $JAVA_OPTS\n\n\nexec "$PRGDIR"/"$EXECUTABLE" start "$@"' > $CATALINA_HOME/bin/startup.sh
# Make djatoka available on the command line
ln -s /opt/adore-djatoka/bin/Linux-x86-32/kdu_expand /usr/bin/kdu_expand
ln -s /opt/adore-djatoka/bin/Linux-x86-32/kdu_compress /usr/bin/kdu_compress
echo "/opt/adore-djatoka/lib/Linux-x86-32" > /etc/ld.so.conf.d/kakadu.conf
ldconfig
# Try to create a propert log4j.properties file for adore-djatoka
echo -e '# REPORTING LEVELS: OFF, DEBUG, INFO, WARN, ERROR and FATAL\nlog.dir=/usr/local/fedora/server/logs/\ndatestamp=yyyy-MM-dd/HH:mm:ss.SSS/zzz\nroll.pattern.hourly=.yyyy-MM-dd.HH\nroll.pattern.daily=.yyyy-MM-dd\n\n#djatoka.log -- Default catch-all.\nlog4j.rootLogger=DEBUG, defaultLog\nlog4j.appender.defaultLog=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.defaultLog.DatePattern=${roll.pattern.daily}\nlog4j.appender.defaultLog.File=${log.dir}/djatoka.log\nlog4j.appender.defaultLog.layout=org.apache.log4j.PatternLayout\nlog4j.appender.defaultLog.layout.ConversionPattern=%d{${datestamp}} [%t] %-5p %m%n' > $CATALINA_HOME/webapps/adore-djatoka/WEB-INF/classes/log4j.properties
sed -i "s|log.dir=/usr/local/fedora/server/logs/|log.dir=$FEDORA_HOME/server/logs/|g" $CATALINA_HOME/webapps/adore-djatoka/WEB-INF/classes/log4j.properties
But like I said, every time travis tries to run the script and test the push it says this:
...
$ sh adore-djakota-install.sh
sh: 0: Can't open adore-djakota-install.sh
The command "sh adore-djakota-install.sh" failed and exited with 127 during before_install.
Upvotes: 1
Views: 2592
Reputation: 10114
sh: 0: Can't open adore-djakota-install.sh
means that sh
can't find the file. It appears to me like you've forgotten to cd
into the directory where the file is located.
Also, remember that you have to cd back into $TRAVIS_BUILD_DIR
at the end of before_script
so Travis can run your actual tests (the default build script expects to be run from $TRAVIS_BUILD_DIR
.
Upvotes: 2