-
Notifications
You must be signed in to change notification settings - Fork 22
/
.travis.yml
107 lines (95 loc) · 3.56 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
# ******************************************************************************
# IBM Cloud Kubernetes Service, 5737-D43
# (C) Copyright IBM Corp. 2021, 2024 All Rights Reserved.
#
# SPDX-License-Identifier: Apache2.0
#
# 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.
# ******************************************************************************
dist: focal
group: vpc
services:
- docker
language: go
go:
- 1.23.3
env:
global:
- CONTAINERIZED_BUILD_TOOLS="true"
- IKS_PIPELINE_IAM_APIKEY="${ALL_GLOBAL_NETWORK_IKS_PIPELINE_IAM_APIKEY_20241110}"
- registry_iam_api_key="${ALL_GLOBAL_registry_iam_api_key_20240423}"
- GHE_TOKEN="${ALL_GLOBAL_GHE_TOKEN_20240424}"
- TRAVIS_INTERNAL_HOSTNAME="v3.travis.ibm.com"
sudo: required
git:
depth: false
jobs:
include:
- name: "Internal"
env: ARTIFACTORY_AUTH_HEADER_FILE="/tmp/.artifactory-auth-header"
- name: "No Artifactory"
env: ARTIFACTORY_AUTH_HEADER_FILE=""
before_install:
- echo "${TRAVIS_BUILD_WEB_URL}"
- if [[ ${TRAVIS_JOB_NAME} == Internal && ${TRAVIS_BUILD_WEB_URL} != *${TRAVIS_INTERNAL_HOSTNAME}* ]]; then echo "Not running on internal Travis host"; travis_terminate 0; fi
- export REPO_ORIGIN_URL=$(git config --get remote.origin.url) && echo "${REPO_ORIGIN_URL}"
- export REPO_BASE_URL=$(echo "${REPO_ORIGIN_URL}" | cut -d'@' -f2 | cut -d':' -f1) && echo "${REPO_BASE_URL}"
- if [[ "${REPO_BASE_URL}" == "" ]]; then export REPO_BASE_URL=$(echo "${REPO_ORIGIN_URL}" | cut -f3 -d'/') && echo "${REPO_BASE_URL}"; fi
- export REPO_SOURCE_URL="https://${REPO_BASE_URL}/${TRAVIS_REPO_SLUG}/commit/${TRAVIS_COMMIT}" && echo "${REPO_SOURCE_URL}"
- export BUILD_URL="${TRAVIS_BUILD_WEB_URL}"
# NOTE(cjschaef): Rather than setup a separate build to access Python 3, override pyenv
- pyenv global system 3.8
- echo "StrictHostKeyChecking no" > ~/.ssh/config
- make setup-build
before_script:
- if [[ ${TRAVIS_EVENT_TYPE} == cron && ${TRAVIS_JOB_NAME} == Internal ]]; then ./kube-update.sh; make runanalyzedeps || true; travis_terminate 0; fi
- make install-golangci-lint
- make lint-copyright
- make classic
- make vpcctl
script:
- make oss
- make fmt
- make lint
- make lint-sh
- make yamllint
- make vet
- make test
- make coverage
- make commands
- make runanalyzedeps || true
- BUILD_SHA=${TRAVIS_COMMIT} BUILD_ID=${TRAVIS_BUILD_NUMBER} BUILD_TAG=${TRAVIS_TAG} make containers
after_success:
- ./scripts/calculateCoverage.sh
deploy:
- provider: script
script: BUILD_TAG=${TRAVIS_TAG} make deploy
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_TAG} == v1.32.0-* && ${TRAVIS_JOB_NAME} == Internal
go: 1.23.3
- provider: script
script: BUILD_TAG=${TRAVIS_TAG} make deploy
skip_cleanup: true
on:
tags: true
go: 1.23.3
condition: ${TRAVIS_TAG} == dev-* && ${TRAVIS_JOB_NAME} == Internal
- provider: script
script: ./scripts/publishTag.sh
skip_cleanup: true
on:
branch: release-1.32
go: 1.23.3
condition: ${TRAVIS_COMMIT_MESSAGE} =~ push_build && ${TRAVIS_JOB_NAME} == Internal