2019-02-07 09:58:09 +00:00
|
|
|
---
|
2018-02-15 21:06:12 +00:00
|
|
|
# need for docker build
|
|
|
|
sudo: true
|
2019-05-22 05:50:53 +00:00
|
|
|
dist: xenial
|
2018-02-15 21:06:12 +00:00
|
|
|
|
2019-02-07 10:22:59 +00:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- realpath
|
|
|
|
- ruby
|
2020-04-01 07:20:43 +00:00
|
|
|
- socat
|
2019-05-22 05:50:53 +00:00
|
|
|
services:
|
|
|
|
- docker
|
2019-02-07 10:22:59 +00:00
|
|
|
|
2018-01-10 18:13:36 +00:00
|
|
|
language: go
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
2020-02-17 12:15:57 +00:00
|
|
|
go: 1.13.x
|
2018-01-10 18:13:36 +00:00
|
|
|
|
2019-02-04 05:31:43 +00:00
|
|
|
env:
|
|
|
|
global:
|
2019-12-12 03:22:55 +00:00
|
|
|
- GOLANGCI_VERSION=v1.21.0
|
2020-02-17 12:15:57 +00:00
|
|
|
- GO111MODULE=on
|
2019-08-30 10:23:10 +00:00
|
|
|
- GOSEC_VERSION=2.0.0
|
2019-02-07 09:58:09 +00:00
|
|
|
- TEST_COVERAGE=stdout
|
|
|
|
- GO_METALINTER_THREADS=1
|
|
|
|
- GO_COVER_DIR=_output
|
2020-04-01 07:20:43 +00:00
|
|
|
- HELM_VERSION=v2.16.5
|
2019-05-22 05:50:53 +00:00
|
|
|
- VM_DRIVER=none
|
2019-12-11 06:12:18 +00:00
|
|
|
- MINIKUBE_VERSION=v1.6.0
|
2019-05-22 05:50:53 +00:00
|
|
|
- CHANGE_MINIKUBE_NONE_USER=true
|
2019-05-29 10:02:16 +00:00
|
|
|
- KUBECONFIG=$HOME/.kube/config
|
2020-03-24 07:53:55 +00:00
|
|
|
# set CEPH_CSI_RUN_ALL_TESTS to non-empty to run all tests
|
|
|
|
- CEPH_CSI_RUN_ALL_TESTS=true
|
2019-07-18 14:31:52 +00:00
|
|
|
|
|
|
|
before_install:
|
2019-11-07 09:55:12 +00:00
|
|
|
- mkdir -p $GOPATH/bin
|
2019-02-04 05:31:43 +00:00
|
|
|
|
2019-12-18 10:29:08 +00:00
|
|
|
before_script:
|
|
|
|
- curl https://download.ceph.com/keys/release.asc | sudo apt-key add -
|
|
|
|
- sudo apt-add-repository
|
|
|
|
"deb https://download.ceph.com/debian-nautilus xenial main"
|
|
|
|
# Ceph does not guarantee arm64 builds, fallback to ceph 14.2.5
|
|
|
|
# yamllint disable rule:line-length
|
|
|
|
- test "$(arch)" != "aarch64" || sudo apt-add-repository
|
|
|
|
"deb https://chacra.ceph.com/r/ceph/nautilus/af06652dc9b2da8c6aadbbecdfafdc7e235abe7d/ubuntu/xenial/flavors/default/ xenial main"
|
|
|
|
# yamllint enable rule:line-length
|
|
|
|
- sudo apt-get -qq update
|
|
|
|
# only the arm64 fallback repo is unsigned and needs --allow-unauthenticated
|
|
|
|
- sudo apt-get -y --allow-unauthenticated install librados-dev librbd-dev
|
|
|
|
|
2019-02-07 09:58:09 +00:00
|
|
|
jobs:
|
|
|
|
include:
|
2020-04-21 09:57:19 +00:00
|
|
|
# two stages for testing, each stage runs its jobs in parallel, but stages
|
|
|
|
# are run after each other, unless the last stage fails
|
|
|
|
# - build testing
|
|
|
|
# - e2e testing
|
|
|
|
- stage: build testing
|
|
|
|
name: static-check-make
|
2019-02-07 09:58:09 +00:00
|
|
|
install:
|
|
|
|
- gem install mdl
|
|
|
|
- pip install --user --upgrade pip
|
|
|
|
- pip install --user yamllint
|
2019-03-04 03:46:31 +00:00
|
|
|
# install golangci-lint
|
|
|
|
- curl -sf
|
2019-07-18 15:16:19 +00:00
|
|
|
"https://install.goreleaser.com/github.com/golangci/golangci-lint.sh"
|
2019-03-04 03:46:31 +00:00
|
|
|
| bash -s -- -b $GOPATH/bin "${GOLANGCI_VERSION}"
|
2019-08-30 10:23:10 +00:00
|
|
|
# install gosec
|
|
|
|
- curl -sfL
|
|
|
|
"https://raw.githubusercontent.com/securego/gosec/master/install.sh"
|
|
|
|
| sh -s -- -b $GOPATH/bin "${GOSEC_VERSION}"
|
2019-08-15 08:44:03 +00:00
|
|
|
# install helm for helm lint
|
|
|
|
- curl -L https://git.io/get_helm.sh | bash
|
2019-02-07 09:58:09 +00:00
|
|
|
script:
|
2020-04-17 10:23:44 +00:00
|
|
|
- make go-lint
|
|
|
|
- make go-lint-text
|
|
|
|
- make gosec
|
2019-07-18 12:12:12 +00:00
|
|
|
- make go-test
|
2020-04-17 10:23:44 +00:00
|
|
|
- make mod-check
|
2019-01-28 11:58:11 +00:00
|
|
|
|
2020-04-21 13:30:40 +00:00
|
|
|
- stage: build testing
|
|
|
|
name: Build multi-architecture image for amd64 and arm64
|
|
|
|
script:
|
|
|
|
- travis_wait ./build-multi-arch-image.sh || travis_terminate 1;
|
|
|
|
|
2020-04-21 09:57:19 +00:00
|
|
|
- stage: build testing
|
|
|
|
name: containerized test (Fedora) and build (CentOS)
|
2020-03-24 09:03:13 +00:00
|
|
|
script:
|
2020-04-18 14:59:16 +00:00
|
|
|
- make containerized-test || travis_terminate 1;
|
2020-03-24 09:03:13 +00:00
|
|
|
- make containerized-build || travis_terminate 1;
|
|
|
|
|
2020-04-21 09:57:19 +00:00
|
|
|
- stage: build testing
|
|
|
|
name: cephcsi on Arm64
|
|
|
|
arch: arm64
|
2019-02-07 09:58:09 +00:00
|
|
|
script:
|
2019-05-29 13:32:15 +00:00
|
|
|
- scripts/skip-doc-change.sh || travis_terminate 0;
|
2019-05-29 10:02:16 +00:00
|
|
|
- make image-cephcsi || travis_terminate 1;
|
2020-04-21 09:57:19 +00:00
|
|
|
# No CI test job is availabe for Arm64 now due to below issues
|
|
|
|
# - k8s-csi sidecar images for Arm64 are not available
|
|
|
|
# - Travis Arm64 CI job runs inside unprivileged LXD which blocks
|
|
|
|
# launching minikube test environment
|
|
|
|
- travis_terminate 0 # deploy only on x86
|
2019-06-13 09:10:02 +00:00
|
|
|
|
2020-04-21 09:57:19 +00:00
|
|
|
- stage: e2e testing
|
|
|
|
name: cephcsi with kube 1.14.10
|
2019-06-13 09:10:02 +00:00
|
|
|
script:
|
|
|
|
- scripts/skip-doc-change.sh || travis_terminate 0;
|
|
|
|
- make image-cephcsi || travis_terminate 1;
|
2020-04-21 09:57:19 +00:00
|
|
|
- scripts/travis-functest.sh v1.14.10 || travis_terminate 1;
|
2018-02-15 21:02:39 +00:00
|
|
|
|
2020-04-21 09:57:19 +00:00
|
|
|
- stage: e2e testing
|
|
|
|
name: cephcsi with kube 1.15.6
|
2019-07-01 07:31:33 +00:00
|
|
|
script:
|
|
|
|
- scripts/skip-doc-change.sh || travis_terminate 0;
|
|
|
|
- make image-cephcsi || travis_terminate 1;
|
2020-04-21 09:57:19 +00:00
|
|
|
- scripts/travis-functest.sh v1.15.6 || travis_terminate 1;
|
|
|
|
|
|
|
|
- stage: e2e testing
|
|
|
|
name: cephcsi with kube 1.17.0
|
2020-03-20 08:26:49 +00:00
|
|
|
script:
|
|
|
|
- scripts/skip-doc-change.sh || travis_terminate 0;
|
|
|
|
- make image-cephcsi || travis_terminate 1;
|
2020-04-21 09:57:19 +00:00
|
|
|
- scripts/travis-functest.sh v1.17.0 || travis_terminate 1;
|
|
|
|
|
|
|
|
- stage: e2e testing
|
|
|
|
name: cephcsi helm charts with kube 1.17.0
|
2020-04-01 07:20:43 +00:00
|
|
|
script:
|
|
|
|
- scripts/skip-doc-change.sh || travis_terminate 0;
|
|
|
|
- make image-cephcsi || travis_terminate 1;
|
|
|
|
- scripts/travis-helmtest.sh v1.17.0 || travis_terminate 1;
|
2019-11-07 09:55:12 +00:00
|
|
|
|
2018-02-15 20:55:06 +00:00
|
|
|
deploy:
|
|
|
|
- provider: script
|
2019-03-04 04:28:37 +00:00
|
|
|
on: # yamllint disable-line rule:truthy
|
2018-12-10 16:05:25 +00:00
|
|
|
all_branches: true
|
2019-02-07 09:58:09 +00:00
|
|
|
script: ./deploy.sh
|