blob: 4ca9ba4af7e92192ef82e4be4c83a851848e3d2b [file] [log] [blame]
# Build script for Travis-CI.
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
ROOTDIR="$SCRIPTDIR/../.."
WHISKDIR="$ROOTDIR/openwhisk"
cd $WHISKDIR
tools/build/scanCode.py .
cd $WHISKDIR/ansible
ANSIBLE_CMD="ansible-playbook -i environments/local"
$ANSIBLE_CMD setup.yml
$ANSIBLE_CMD prereq.yml
$ANSIBLE_CMD couchdb.yml
$ANSIBLE_CMD initdb.yml
cd $WHISKDIR
./gradlew distDocker
cd $WHISKDIR/ansible
$ANSIBLE_CMD wipe.yml
$ANSIBLE_CMD openwhisk.yml
cd $WHISKDIR
VCAP_SERVICES_FILE="$(readlink -f $WHISKDIR/../tests/credentials.json)"
#update whisk.properties to add tests/credentials.json file to vcap.services.file, which is needed in tests
WHISKPROPS_FILE="$WHISKDIR/whisk.properties"
sed -i 's:^[ \t]*vcap.services.file[ \t]*=\([ \t]*.*\)$:vcap.services.file='$VCAP_SERVICES_FILE':' $WHISKPROPS_FILE
cat whisk.properties
WSK_CLI=$WHISKDIR/bin/wsk
AUTH_KEY=$(cat $WHISKDIR/ansible/files/auth.whisk.system)
EDGE_HOST=$(grep '^edge.host=' $WHISKPROPS_FILE | cut -d'=' -f2)
WSK_NAMESPACE=/whisk.system
# Set Environment
export OPENWHISK_HOME=$WHISKDIR
# Install the package
source $ROOTDIR/packages/installCatalog.sh $AUTH_KEY $EDGE_HOST $WSK_NAMESPACE $WSK_CLI
# Test
cd $ROOTDIR
./gradlew :tests:test