Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8edaaf
commit 7a1d73b
Showing
11 changed files
with
232 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
language: go | ||
go: | ||
- "1.11.x" | ||
dist: trusty | ||
dist: xenial | ||
sudo: required | ||
services: | ||
- docker | ||
|
||
go_import_path: github.com/ibm/openwhisk-operator | ||
|
||
before_install: | ||
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
- ./tools/travis/start-kubeadm-dind.sh | ||
- ./tools/travis/k8s-tools.sh | ||
- ./tools/travis/minikube-install.sh | ||
- ./tools/travis/bx-install.sh | ||
- ./tools/travis/bx-setup.sh | ||
- if [ ! -z "$RUN_DEP" ]; then curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh ; fi | ||
- go get -v github.com/onsi/ginkgo/ginkgo | ||
|
||
install: | ||
- dep ensure -v | ||
- if [ ! -z "$RUN_DEP" ]; then dep ensure -v; fi | ||
|
||
jobs: | ||
include: | ||
- stage: test | ||
script: make test | ||
env: | ||
- KB_VERSION=1.0.5 | ||
# - script: test/e2e/install-local.sh | ||
- KB_VERSION=1.0.5 REMOTE_OPENWHISK=1 INSTALL_IBMCLOUD=1 INSTALL_K8S_TOOLS=1 RUN_DEP=1 | ||
# - script: test/e2e/test-install.sh | ||
# env: | ||
# - INSTALL_DIND=1 INSTALL_K8S_TOOLS=1 | ||
#- script: test/e2e/test.sh | ||
# env: | ||
# INSTALL_MINIKUBE=true | ||
# - INSTALL_DIND=1 INSTALL_K8S_TOOLS=1 | ||
- script: test/e2e/test.sh | ||
env: | ||
- INSTALL_MINIKUBE=1 INSTALL_K8S_TOOLS=1 | ||
- stage: deploy | ||
script: bash tools/travis/docker.sh | ||
env: | ||
- RUN_DEP=1 | ||
skip_cleanup: true | ||
if: branch = master OR env(TRAVIS_TAG) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2017-2018 IBM Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
# wait for the operator to be ready | ||
function object::wait_operator_ready() { | ||
printf "Checking operator status .." | ||
until [ "$(kubectl -n openwhisk-system get po | grep 'Running' | awk '{print $3}')" == "Running" ]; do | ||
printf "." | ||
sleep 2 | ||
done | ||
printf $CHECKMARK | ||
echo "" | ||
} | ||
|
||
# wait for resource to be online | ||
function object::wait_resource_online() { | ||
local kind="$1" | ||
local name="$2" | ||
local retries="$3" | ||
|
||
printf "waiting for $kind $name to be online ." | ||
local i | ||
for i in $(seq 1 "$retries"); do | ||
if [ "$(kubectl get $kind $name -o=jsonpath='{.status.state}')" == "Online" ]; then | ||
printf $CHECKMARK | ||
echo "" | ||
return 0 | ||
fi | ||
printf "." | ||
sleep 2 | ||
done | ||
|
||
printf "timeout $CROSSMARK" | ||
echo "" | ||
return 1 | ||
} | ||
|
||
# wait for function to be online | ||
function object::wait_function_online() { | ||
local name="$1" | ||
local retries="$2" | ||
|
||
object::wait_resource_online "functions.openwhisk.seed.ibm.com" $name $retries | ||
} | ||
|
||
# wait for package to be online | ||
function object::wait_package_online() { | ||
local name="$1" | ||
local retries="$2" | ||
|
||
object::wait_resource_online "packages.openwhisk.seed.ibm.com" $name $retries | ||
} | ||
|
||
# wait for trigger to be online | ||
function object::wait_trigger_online() { | ||
local name="$1" | ||
local retries="$2" | ||
|
||
object::wait_resource_online "triggers.openwhisk.seed.ibm.com" $name $retries | ||
} | ||
|
||
|
||
# wait for rule to be online | ||
function object::wait_rule_online() { | ||
local name="$1" | ||
local retries="$2" | ||
|
||
object::wait_resource_online "rules.openwhisk.seed.ibm.com" $name $retries | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
#!/bin/bash | ||
# | ||
# Copyright 2017-2018 IBM Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
COLOR_RESET="\e[00m" | ||
COLOR_GREEN="\e[1;32m" | ||
COLOR_RED="\e[00;31m" | ||
|
||
BOLD=$(tput bold) | ||
NORMAL=$(tput sgr0) | ||
|
||
CHECKMARK="${COLOR_GREEN}✔${COLOR_RESET}" | ||
CROSSMARK="${COLOR_RED}✗${COLOR_RESET}" | ||
|
||
# print header in bold | ||
function u::header() { | ||
echo "" | ||
echo ${BOLD}${1}${NORMAL} | ||
} | ||
|
||
# print test suite name | ||
function u::testsuite() { | ||
u::header "$1" | ||
u::header "${BOLD}====${NORMAL}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.