blob: b3458d991b102fad7f8ff9d98eb5bd63fe459867 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
language: go
matrix:
include:
- os: linux
sudo: required
group: deprecated-2017Q3
go: 1.8
services: docker
env:
global:
- secure: "Br0fD9CAKm8gqyEuwmltNJd4dGJCxPpj6feugHlO+CFFwfE/+kJKkpTlsDuRfrUzUDlWiETNPf0XGSjvPFqZExnLCE9XQh2+XF6u+S3YBWfM+rbbyRVAK6BlTwmt0u3jRJ2JP7spedTGZA+qfIWI+UkwoOexo7NcqtMPLahiZzheaaad8y3J+crHQCrB/kPrhLqKVMEOkIbveFdfV2QLfCOWgqP8e1LGZhPZ2N4QcNo0iB5uI4ZyYszTZDniXFKxz7kBs4tl4ZQDqRHqL02qKPsjbvjrZp83ql+PbC2dpgXi9YpaDuBEqKKX1rTQP5ppcwbobot5U3ItHWzpXbLCdsWxvbde/0enjMmOF1wwl71hPYIf7PkQmNAWXRtL2Z1TguO/dKCeXBLDER4YDQ79GYpikAMqnrRLou4rsyZrNUzg8aHbELzAHppDSpqEJN8ymGgWgmWBT8yPaWVwN5CjPFOxLPrVEObcwcNSGOcOvtmUGCnXKSZminNZUjz5QfWqpA+LYCUIbeOI2X2D+iQWklWONaU2A+PcNLaaegwwj4K+9ZlU08Ed8Ud5ZGhjN9s72OtoFPdSHAyBgf/qxIdnTzmmE+SQ90mDtG3VqjHy28Ix7cIGqaIEC8shFb0kKHqQ7AVkLPm0bsh2fbbYu/5YVpXHfxlKWfOLBV14bHUq3v0="
- build_file_name=wsk
# WARNING: if zip_file_name includes spaces or leading hyphen(s), it will create cosmetic breakage in 'before_deploy'
- zip_file_name=OpenWhisk_CLI
git:
depth: 3
notifications:
email: false
webhooks:
urls:
# travis2slack webhook to enable DMs on openwhisk-team.slack.com to PR authors with TravisCI results
secure: "nv1E5INzU77zNDxNj/aNI9nutdSq4Fv2o9JUSmb0C0/OAs/0iXHGL1UVSdyIjQ6RozOmd2rped5/n9pgqPDk4FaYfyVv+80k6KNdm47Yx99kOMrMyLjOV4HyYp4SmNmZVoLoYndDyyozL7NRs2fdZgk5xfnWoHSix364PVFA+gJtVFgF2vSq1cEXDLaRb21WoGpWjMQvojHiXWSdO811BpiEFruPdhfUFkU3UdzqNmz/0zW6Aj0mJTYSh+6a6j2QIN7D9tfzMNA/00g1d6VwXRokLamQFkd40hOX8Mx5h6hxdHjFSY0tdSvzCcY2jqqLZegVi9/Sm/aEM4z0VVj2/XqosASw+RB5O1R1ekOqsobf9Ru3DhLDj+frWYbLfQwJ54kQxki8bsbmxNWiK+PhKvJfq2ACTkKmGw76t6C1RJHUV2Q6o04riFlqe7T7bxKU3E6fL2fsI7zMOkjIW5MOT+iAeqzi5q8d1TDEj00Ppdi0O6v+dWzpwGXFvslClLDY5pa3BNh590kQ/CW1O6gCpQ0RIaKNvrEW0xV0rpafMThwWuO07n28KNVz/nntYAHRBIS7Pzdq1JOrvRhsCkOGiAdcQ00OmhprEBahXOGGXXqGRo0XvsaEGvcNe7yAbQ/LYtuTM0PUs54tEHSj9tbLV4ZRuL+qYNrn8gZIXtiuO54="
before_install:
- export DEPLOY_BUILD_READY=false
install:
- cd $TRAVIS_BUILD_DIR/..
- pip install --upgrade pip setuptools
before_script:
- cd $TRAVIS_BUILD_DIR
- ./gradlew --console=plain checkScalafmtAll
- GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/)
- test -z "$(gofmt -s -l $(echo $GO_FILES))"
- cd $TRAVIS_BUILD_DIR/..
- git clone https://github.com/apache/incubator-openwhisk-utilities.git
- git clone https://github.com/apache/incubator-openwhisk.git
- cd incubator-openwhisk
- ./tools/travis/setup.sh
script:
- cd $TRAVIS_BUILD_DIR/../incubator-openwhisk
- ./gradlew install
- cd $TRAVIS_BUILD_DIR
- export BUILD_VERSION="latest"
- if [ ! -z "$TRAVIS_TAG" ] ; then
export BUILD_VERSION=$TRAVIS_TAG;
fi
- ./gradlew --console=plain releaseBinaries -PpackageVersion=$BUILD_VERSION
- ./tools/travis/test_openwhisk.sh
after_success:
- export DEPLOY_BUILD_READY=true
- if [ "$TRAVIS_EVENT_TYPE" == "cron" ] ; then
export DEPLOY_BUILD_READY=false;
fi
before_deploy:
- export RELEASE_PKG_FILE="$(cd "$TRAVIS_BUILD_DIR/release" && ls ${zip_file_name}-*.tgz ${zip_file_name}-*.zip)"
- echo "Deploying $RELEASE_PKG_FILE to GitHub releases."
- export GIT_TAG="latest"
- export TAG=false;
# This tag is automatically generated for the latest merged commit in master branch.
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_EVENT_TYPE" == "push" ] && [ "$TRAVIS_OS_NAME" == "linux" ] ; then
git config --global user.email "builds@travis-ci.com";
git config --global user.name "Travis CI";
export GIT_TAG="latest";
git tag -d $GIT_TAG;
git push -q https://$API_KEY@github.com/apache/incubator-openwhisk-cli :refs/tags/$GIT_TAG;
GIT_COMMITTER_DATE="$(git show --format=%aD | head -1)" git tag $GIT_TAG -a -m "Generated tag from Travis CI build $TRAVIS_BUILD_NUMBER";
git push -f -q https://$API_KEY@github.com/apache/incubator-openwhisk-cli $GIT_TAG;
fi
- if [ ! -z "$TRAVIS_TAG" ] ; then
export GIT_TAG=$TRAVIS_TAG;
export TAG=true;
fi
- echo "The GIT_TAG of this Travis build is $GIT_TAG."
deploy:
provider: releases
api_key:
secure: Yh1aYiM/qIWkPMSVjGUq1g9TjpACjavQ00QAqp4oqghNZc6xBcmdzsfD2VjzVPHleNI1FIZyjJ1x6laRfWBzRkAcJcjUHXA2bO/V0jqePVmgVm75WwTZ/9EaWIJeAg5CQMm5DGS28Yhc60C0ut3ZzKMWGTiKb73UADXPTGd/tjndxjfksX/THXPuInKB9QZesmluBAC2am/x/6J311WA2wqe0p1+9JFwMr8XwIcwzCwgi/d9CFpS1RnVpLE/ORSgmN/dFbZ7A/qVbx377QoxKiEB0jmUwi13f7REFAw18JdgzbQCH3X4HNu9pCJwHEAq3lP2CfmHbAXcViBeji/Xh9PPJVV9TYqO+uT8oPxCPJND1A/3O2xJ8LyZ/FP2bWqG/Ds/8SZCvxfOR/X77opUeZ4qAp7HJMVCsFi3TsnmzxCe0BOxCppVJLhoSZ2rOAPJi9mKgS/Z/VA5VhNNmnPtkReEWK4vT9h3/iCwv9anvC0RKeLckSHpCm5C5otNXtV4L990fL5L5krMatxynHnCmmhYeLg/Ns+5ncax58Y8hmhnhzTqbPGHpe79bJRfvwRI9lboq7kEj4x5O/M16TKRfQ8ZU5UHvrCPdlTfT7NUXRGZkvWX20X6Ta/DRROTF+xZGiq7da3Oi+xyNDx/LmymfR49thjzgIPXVZolknGYQ9Q=
file_glob: true
file:
- release/${zip_file_name}-*.tgz
- release/${zip_file_name}-*.zip
overwrite: true
skip_cleanup: true
target_commitish: $TRAVIS_COMMIT
tag_name: $GIT_TAG
on:
repo: apache/incubator-openwhisk-cli
tags: $TAG
condition: "$DEPLOY_BUILD_READY = true"