blob: 54906f7883bae75ab8d9715cdf10d957cc1aed93 [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.
#
sudo: required
language: go
matrix:
include:
- os: linux
sudo: required
go: "1.18"
services: docker
dist: xenial
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: "NaDCtHwbFUEy0h0u/QrAt395o0/9FstJ5/Tv4uBSLCBdaUNU+0q6/RXVH76dKbujoxrLded2gyeJSAbI4kl4SM7FyilSHzKTikF0VsgM3G5veh65tVY5ztsvl40hDmK2E/PmWI3HkZNeWJO32WjraqPmhSWL0BZOWhA/4gJSCIsLnNRQXmpZoDqC7V8IG1BWYGwd5qcNkEjItLjYCUy1s2K8bj3QmhshYRVLTNbXxh0yJVKjM04I+bWhMXqvL8GS55qeicJ3fUwm5g1PDVCtzxLwAHCPo2jusjtNSnV+BaZgMBSahv3MD7ApxfF58e1buejggH3qZAhNGccC4bYJCahqVv/KKoA10kO6exH5iGwlHPWQTjMuF++PHmAk+FeQ1jh+JoUSBnIHExPnaD4CQIArHvUuQom+WJBnOz+L1H755VyPGzeDQ+ZUDlhOiQ6CDP/sqaRH3Wmo4IzhsqTsLaQs0dS1YeEWOS8gcawwNTVf/WtqiedYu24rQN9RiUXelRoEaXJy/pldb2KpyQRo2hbKoStDDB5fEij1xyGsj4kSXZ8uk5G10oDGnZYd+okduzJazN8wr0flrLvH32DRgDZDcG/D90I19JmqqfqbcG/SEmhxTikHZeVQd5DfWcqssLvWNrtQa/EJgAQkmZ2gaSsZ73AvPk/KyMV30+m8xTU="
# The complete sequence of phases of the lifecycle:
# ---------------------------------------------------------
# before_install
# install
# before_script
# script
# before_cache (OPTIONAL) (if and only if caching is effective)
# after_success (or after_failure)
# before_deploy (OPTIONAL) (if and only if deployment is active)
# deploy (OPTIONAL)
# after_deploy (OPTIONAL) (if and only if deployment is active)
# after_script
before_install:
- "./tools/travis/cloneutils.sh"
- sudo apt-get install tree
# Install tools we use for linting and unit/integration testing
# TODO: build.gradle (gradlew) already installs 'golint' and runs linting
# in the `goLint` task; see if we can remove here.
# TODO: The "gogradle" plugin in build.gradle (gradlew) already provides a
# task called "goTest" which runs all `unit` tests. See if we can use that
# instead and only run `integration` tests here.
install:
- export DEPLOY_BUILD_READY=false
- go get -u golang.org/x/lint/golint
- go get -u github.com/stretchr/testify
# Identify Golang files that are not properly formatted
# TODO: See if we can create custom tasks to perform this in build.gradle
# as a custom `goFmt` task
before_script:
- GO_FILES=$(find . -iname '*.go' -type f -not -path "./wski18n/i18n_resources.go")
- export BAD_GO=$(gofmt -s -l $(echo $GO_FILES))
- echo "["$BAD_GO"]"
#- test -z "$BAD_GO"
#- test -z "$(gofmt -s -l $(echo $GO_FILES))"
# Clone and build the OpenWhisk platform (i.e., apache/openwhisk)
# and then use Ansible to deploy it and prepare it to run our
# integration tests.
# TODO: Do not use Makefile for running integration tests (in script.sh);
# change to using gradle wrapper
script:
- echo "Installing and building OpenWhisk platform using Ansible..."
- "./tools/travis/showenv.sh"
# - "./tools/travis/script.sh"
# after_success:
# - DEPLOY_BUILD_READY=true
# - if [ "$TRAVIS_EVENT_TYPE" == "cron" ] ; then
# export DEPLOY_BUILD_READY=false;
# fi
# If this is a "tagged" GitHub build, then use Gradle Wrapper
# to build binaries for all supported OS platforms and architectures.
# The result would be a "/build" directory that has a subdirectory named
# for each supported GOOS/GOARCH
before_deploy:
- export build_file_name=wskdeploy
- go get github.com/inconshreveable/mousetrap
- export GIT_TAG="latest"
- export TAG=false
- if [ ! -z "$TRAVIS_TAG" ] ; then
export GIT_TAG=$TRAVIS_TAG;
export TAG=true;
fi
- echo "Calling Gradle Wrapper task to build and 'releaseBinaries'..."
- "./tools/travis/showenv.sh"
- ./gradlew --console=plain releaseBinaries -PpackageVersion=$GIT_TAG -PgitCommit=$(git rev-parse HEAD) -PbuildDate=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
- echo "Build binaries and release archives created:"
- tree /build
- tree /release
- 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..."
- 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";
git tag -d $GIT_TAG;
git push -q https://$API_KEY@github.com/apache/openwhisk-wskdeploy :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/openwhisk-wskdeploy $GIT_TAG;
fi
- echo "Completing before_deploy stage"
# Utilize two providers to create a github release and publish a docker image.
# For information on the "releases" provider,
# see https://docs.travis-ci.com/user/deployment/releases/
deploy:
- provider: releases
api_key:
secure: aQGcP7XKlgZEFZ57y4RzYRHfQAM5HEdaa7Y/vTxNepIsE7zY2945qT99UJnU1hfhSjP9jO5eNlHzo+AqJoUx70+iUIhMTyOp39Qp7wb74OKolkXwcntufzP7Ocron5IYUE311tf/kic3vRb5cwoaE2lGfx5PdCuozVjgpsDbIRvV5quQzNr68Toqe+yegKwAhprYRWHPnuIqGbkfa83csqFv6m0viC/gvtFOCB9/4zGCqk/K3CKrcr/5GvnFPxJoaJNfFA6umSZ9VaJjbIJmcXGD3nU+rWP0uEpvzGKIMYhmQq/0JuUTgvh4jnnT4OVZeTh6pMaUqtWH+3HDrOiLAiLjcfeT91j7ZXPnx8LvM6SuoRlvRCuXA2FYx9mz2Vx0TWV5TMqhj3okVO/CvvnMMWwKWOUDD/nSMLy93BM40NjD7zimGjocPsGAjTT9H1PSfau3fiiMjg6iMRWjUTfNY5ra5Wgb7W5G37XaCBJDBZL77Blq/tNWdV5qW4A3l4FWnH+LwOdTdhU35Lr5JWzMuEDdkvVgEv8AQjb07P/ODtBW6z3GRv9Rslg9T9ylxkgJpXoYwdXCbtYU8GNcFdJiDpTaVHrkMeLvHrBTRrDCSnCnRFc3AxsUtLklo7R/EX1wUoX+QcAGjh/AmJ4nJVP1C09913fx96WczkRX6ANg2Mw=
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/openwhisk-wskdeploy
tags: $TAG
condition: "$DEPLOY_BUILD_READY = true"
- provider: script
skip_cleanup: true
script: "./tools/travis/docker/publish.sh openwhisk wskdeploy ${TRAVIS_TAG}"
on:
repo: apache/openwhisk-wskdeploy
tags: true
condition: "$DEPLOY_BUILD_READY = true"
# Clean up wskdeploy binary (single)
# Fundamentally, remove both /build and /release directory trees and contents
# TODO: See if this is really needed in Travis environments as the
# Makefile is not used elsewhere here (especially if we do not use th
# build_tag_release.sh script) as it is for Windows developers primarily
# and we are building using Linux.
# after_script:
# - make clean
# - tree /build
# - tree /release
env:
global:
- BLUEMIX_APIHOST=openwhisk.ng.bluemix.net
- secure: ClspSsyTZdDNen+qZFAN37gP6T0HO4hthuDMb/w/xekznNazoKajTh1XQg5ccQ9o7BuXt5/Mrv8ZbHIg4GQrW4puLxkqfdd956szTDznxU0zgOK23YwdPhf74Uga2ucXOJcNeOcfrgR6jtTQZ2TbS2u11PjC6yp7KKY1vYEJXsbTkJ761H7Geu4qY7PmZ0x/Srw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RNoxbzV1+jRkJ0MnzsV80Iq1z9QWFmSyb6VWQhtV0PfYyrepp8LtV5LcvrGUzwALo8FHzQUHTWi5SyTOVARAIV+luh8Rr7pXzkzwCUdDyu1Qs9gYtksEmCYrzBjqcyGlK53SN7PAKFeE/yt8DUqhB1bvCSRwbUINo4Ua36d7V4hkk1RKdN8k8ER4kgTzoCyV/6vJrN6G7Tc0Vst5fyfnR0O4tnetMnsX4Opwas3DFTW6gzBrVcTO8Dcf1jdJVfUXeeDbkx1auv11Xn2YodKJ+t/qoC9z6X7FftU2PXJwJxWCMw6ubnIFMMGfjwFN3f7gJBuztiVBczRYE3wb3alv0hz1xdtdLeTClDW/E="
- secure: "lnMMHCtl/ttDmA7tIFkj5TwXmWr46+bVDm8hRD9VI8+7cMnCAZb3MZ+2Nr7rpyi7YhklOAGW6F9vMIlWQQUiaEezpIe/4xmWDw9U4SmNhasi4gHw1Ux+BqV7xOY87Rhma67JfaToddMuhXZqjxMP3ux+oq245dTKEAh4bPjF9YnIoFl8UdZMrFykAS6uW/ON1jx49weQhjBR0uZBFNIvmorWiR1SmEPMTUik9BNh6Fdu9+3pb50UVN7TTNM9uIuOkvlUAdTBLC4kDajvKfM7ewy7rgnQlmhVvwV+jj3lmxxarU3jauNELGsI3PJnNpkHvoV9u2TGaDzwzDhQj1+JWq5eXE08N9vAZK27ohFxjDpSxPm681uek358tjagIF6QU56RohIOse4U/8Y5rawyD7ISXuDXqjLBMzncPr3Dz69wtenIqRdW72BAh+5O7p1RW+SX/lVAUBSSflQaLEKrntm17Ub2XE/TAx/bHq7xIoVZwBL7DrhdHUl6c3qfW7fwbHt1GU5pFW91mAbuLBpJV+fCJVrMOYU7ZOsSArGO9bbMU0IxjIB1QU9/BUE/aXqpyIsV6deP5QxqNj8IUVdld3N7GzSSxfILvQ0YlAlUquYM4eobNB4+cGZHOn+ermWHP39osXOMuufewXH+1y3zCiIDXCrhW6cbbx+8UHMO6tU="
# API_KEY used to generate the "latest" tag automatically
- secure: CHEYJanoGBV2W9LqBbnG312cOBj4FIWeiLLjfult/VDcjBlAQ71EzpBEv+H9c5J5ZmeRouQ3+dUC2wCJTCeTdzAOIi9Qci7tvTT8yYPShqGS3R1q+Hx1VBaGZhEDpxDcUDDGETBOQD6du7OTKOy+4bW0EdgZA6XENcIQNp5lCPVA2BMp8wI4vUgydbK3Po1vbj4KauBtk+XPU7cUkTxtw/QUyC5Eih6QphVovBIIngBSP917sO0ENwQHjOOkCb0rG1b5OnrAMOQSbpQsVgblv8caKINqnLG5aePN3YJCB5AFzXtQI515RQ9Tf8mX1XSceFtPwAfJhqLw8kHCoiu/ptLi/rxhuv1DTD+t+Y7413bMg/qIP08KKjyj+ScyeMRVnPEfNRC+z98Ka55FDhid9+FDx0uQ7ICDpi/TkCv8GDStk55vkSp3tYfNbORk453y4K6Yf7eS041ugfC3KejlmU2IPulwxQCFjFDZl7JMZo5NMOqBj6RUStWiF3DlxcM2M0I97B2cycwL6jTOlvFJUEFPoU9UIN9ICEYRdY33nxyG5qr+ymq0YgmZqmcjK3dGd5j32xXMqsDO+vrG+CnEpwht7uo6IQWYD44qsixe8J4HcoSYkm901mQYqT7VpNy6BXqHjPBSFUYkHaV/whT6QtCxKaaa7dg0s/jqi/zAnQY=
- zip_file_name=openwhisk_wskdeploy