From 4e0478a32354b3ac2bfc7c2f240784ecfefddc52 Mon Sep 17 00:00:00 2001 From: Olivier Tardieu Date: Tue, 27 Feb 2018 15:48:28 -0500 Subject: [PATCH] Deploy local openwhisk and redis for travis build --- .travis.yml | 12 +++++++----- test/test.js | 2 +- travis/setup.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) create mode 100755 travis/setup.sh diff --git a/.travis.yml b/.travis.yml index 3658d14..c13ce0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ language: node_js node_js: - - "6" - + - 6 +services: + - docker env: global: -# - __OW_API_HOST="OpenWhisk host" -# - __OW_API_KEY="OpenWhisk API key" -# - REDIS="Redis url" + - IGNORE_CERTS=true + - REDIS=redis://172.17.0.1:6379 +before_script: + - ./travis/setup.sh diff --git a/test/test.js b/test/test.js index b64bacd..76e867d 100644 --- a/test/test.js +++ b/test/test.js @@ -9,7 +9,7 @@ const invoke = (task, params, $blocking = true) => run(Object.assign({ $invoke: let activationId describe('composer', function () { - this.timeout(20000) + this.timeout(60000) before('deploy conductor and sample actions', function () { return harness.deploy() diff --git a/travis/setup.sh b/travis/setup.sh new file mode 100755 index 0000000..138c3a6 --- /dev/null +++ b/travis/setup.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -e + +# Build script for Travis-CI. + +SCRIPTDIR=$(cd $(dirname "$0") && pwd) +ROOTDIR="$SCRIPTDIR/.." +IMAGE_PREFIX="composer" +WHISKDIR="$ROOTDIR/openwhisk" + +# OpenWhisk stuff +cd $ROOTDIR +git clone --depth=1 https://github.com/apache/incubator-openwhisk.git openwhisk +cd openwhisk +./tools/travis/setup.sh + +# Pull down images +docker pull openwhisk/controller +docker tag openwhisk/controller ${IMAGE_PREFIX}/controller +docker pull openwhisk/invoker +docker tag openwhisk/invoker ${IMAGE_PREFIX}/invoker +docker pull openwhisk/nodejs6action +docker tag openwhisk/nodejs6action ${IMAGE_PREFIX}/nodejs6action + +# Deploy OpenWhisk +cd $WHISKDIR/ansible +ANSIBLE_CMD="ansible-playbook -i ${WHISKDIR}/ansible/environments/local -e docker_image_prefix=${IMAGE_PREFIX}" +$ANSIBLE_CMD setup.yml +$ANSIBLE_CMD prereq.yml +$ANSIBLE_CMD couchdb.yml +$ANSIBLE_CMD initdb.yml +$ANSIBLE_CMD wipe.yml +$ANSIBLE_CMD openwhisk.yml -e cli_installation_mode=remote -e limit_invocations_per_minute=600 + +# Deploy Redis +docker run -d -p 6379:6379 --name redis redis:3.2 + +docker images +docker ps + +cat $WHISKDIR/whisk.properties +curl -s -k https://172.17.0.1 | jq . +curl -s -k https://172.17.0.1/api/v1 | jq . + +# Setup +WHISK_APIHOST="172.17.0.1" +WHISK_AUTH=`cat ${WHISKDIR}/ansible/files/auth.guest` +WHISK_CLI="${WHISKDIR}/bin/wsk -i" + +${WHISK_CLI} property set --apihost ${WHISK_APIHOST} --auth ${WHISK_AUTH} +${WHISK_CLI} property get