forked from apache/openwhisk-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
116 lines (104 loc) · 5.68 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#
# 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
go: "1.15"
services: docker
dist: xenial
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: "kDRRf+tVeBtPaPai8/ZCV/HdIJ0Oz0+xNCrBINnapKMJDcoNNIfNDPQc4sKJ3fPE9SVYjdiIyBqukggN9JeyhJAUQHcgUm5MAeM6Vut4M3EiAZHrs03do4Syax0MeHUJykaTkk/vQCQbMaHBpzz1DlNdwigTE4JNJNYU8ZDLSP2p2+qTUUouMdA2Wa3RDghTlGtGQOOL13YKvYuQSd1jVDrHpsnRSBfbdOd4IdUr5Og9TrzJQ6J9nl+zBO8r9cYmGdcWchQI2IxzdrOaTODqVRaVo8GF3e8Qzbqu0ZVqqYQYeFWGkfHKfRZLKpxTDuvQUhNrLaa0J1EwW14Z+2wM7PRg1S8VyGTo/jAba0niQMyW00/a2FLcGkacBUozvHfDN1xpEy2RtDjmPeyk/ZsrWkyyXF/lk2kJawPUy+kG7k2WeM+EN6ZFl9/OpjLZ75hgBsnJlzsDlbXkzQfmqshyEQB8l6c+OF9Mhme5KDNFGlbYyUruwKTghIvKLqU8wlVv8wC9D5ArdzeR7fqYAl4ikqpv6aZOwUwgHJXTEDSJ5A2QdIYIdjBwWJG6bJpMK36XY4ZpijKtiNs+4MhX/XNMx3FswkblhXKFdXaze5A6nwj5lkSmJ1I67F18FNN1dsPsEGpQT0xHP/Kdbc9CgPqeEq26OSml4Fl9IaBQquGeZnw="
before_install:
- export DEPLOY_BUILD_READY=false
install:
- cd $TRAVIS_BUILD_DIR/..
- pip install --user --upgrade pip setuptools
before_script:
- cd $TRAVIS_BUILD_DIR
- ./gradlew --console=plain checkScalafmtAll
- GO_FILES=$(find . -iname '*.go' -type f)
- test -z "$(gofmt -s -l $(echo $GO_FILES))"
- cd $TRAVIS_BUILD_DIR/..
- git clone https://github.com/apache/openwhisk-utilities.git
- git clone https://github.com/apache/openwhisk.git
- cd openwhisk
- ./tools/travis/setup.sh
script:
- cd $TRAVIS_BUILD_DIR/../openwhisk
- ./gradlew install tests:buildArtifacts
- 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 $BUILD_VERSION
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;
- if [ ! -z "$TRAVIS_TAG" ] ; then
export GIT_TAG=$TRAVIS_TAG;
export TAG=true;
fi
# 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 "[email protected]";
git config --global user.name "Travis CI";
export GIT_TAG="latest";
git tag -d $GIT_TAG;
git push -q https://[email protected]/apache/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://[email protected]/apache/openwhisk-cli $GIT_TAG;
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/openwhisk-cli
tags: $TAG
condition: "$DEPLOY_BUILD_READY = true"