Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit f3f2e5e

Browse files
authored
Deploy local openwhisk and redis for travis build (#36)
1 parent 36eaad3 commit f3f2e5e

File tree

3 files changed

+59
-6
lines changed

3 files changed

+59
-6
lines changed

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
language: node_js
22
node_js:
3-
- "6"
4-
3+
- 6
4+
services:
5+
- docker
56
env:
67
global:
7-
# - __OW_API_HOST="OpenWhisk host"
8-
# - __OW_API_KEY="OpenWhisk API key"
9-
# - REDIS="Redis url"
8+
- IGNORE_CERTS=true
9+
- REDIS=redis://172.17.0.1:6379
10+
before_script:
11+
- ./travis/setup.sh

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const invoke = (task, params, $blocking = true) => run(Object.assign({ $invoke:
99
let activationId
1010

1111
describe('composer', function () {
12-
this.timeout(20000)
12+
this.timeout(60000)
1313

1414
before('deploy conductor and sample actions', function () {
1515
return harness.deploy()

travis/setup.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Build script for Travis-CI.
5+
6+
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
7+
ROOTDIR="$SCRIPTDIR/.."
8+
IMAGE_PREFIX="composer"
9+
WHISKDIR="$ROOTDIR/openwhisk"
10+
11+
# OpenWhisk stuff
12+
cd $ROOTDIR
13+
git clone --depth=1 https://github.com/apache/incubator-openwhisk.git openwhisk
14+
cd openwhisk
15+
./tools/travis/setup.sh
16+
17+
# Pull down images
18+
docker pull openwhisk/controller
19+
docker tag openwhisk/controller ${IMAGE_PREFIX}/controller
20+
docker pull openwhisk/invoker
21+
docker tag openwhisk/invoker ${IMAGE_PREFIX}/invoker
22+
docker pull openwhisk/nodejs6action
23+
docker tag openwhisk/nodejs6action ${IMAGE_PREFIX}/nodejs6action
24+
25+
# Deploy OpenWhisk
26+
cd $WHISKDIR/ansible
27+
ANSIBLE_CMD="ansible-playbook -i ${WHISKDIR}/ansible/environments/local -e docker_image_prefix=${IMAGE_PREFIX}"
28+
$ANSIBLE_CMD setup.yml
29+
$ANSIBLE_CMD prereq.yml
30+
$ANSIBLE_CMD couchdb.yml
31+
$ANSIBLE_CMD initdb.yml
32+
$ANSIBLE_CMD wipe.yml
33+
$ANSIBLE_CMD openwhisk.yml -e cli_installation_mode=remote -e limit_invocations_per_minute=600
34+
35+
# Deploy Redis
36+
docker run -d -p 6379:6379 --name redis redis:3.2
37+
38+
docker images
39+
docker ps
40+
41+
cat $WHISKDIR/whisk.properties
42+
curl -s -k https://172.17.0.1 | jq .
43+
curl -s -k https://172.17.0.1/api/v1 | jq .
44+
45+
# Setup
46+
WHISK_APIHOST="172.17.0.1"
47+
WHISK_AUTH=`cat ${WHISKDIR}/ansible/files/auth.guest`
48+
WHISK_CLI="${WHISKDIR}/bin/wsk -i"
49+
50+
${WHISK_CLI} property set --apihost ${WHISK_APIHOST} --auth ${WHISK_AUTH}
51+
${WHISK_CLI} property get

0 commit comments

Comments
 (0)