2019-02-07 09:58:09 +00:00
|
|
|
---
|
2018-02-15 21:06:12 +00:00
|
|
|
# need for docker build
|
2020-06-30 11:05:19 +00:00
|
|
|
os: linux
|
2020-05-29 07:49:08 +00:00
|
|
|
dist: bionic
|
2018-02-15 21:06:12 +00:00
|
|
|
|
2019-02-07 10:22:59 +00:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
2020-05-29 07:49:08 +00:00
|
|
|
- coreutils
|
2019-02-07 10:22:59 +00:00
|
|
|
- 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:
|
2020-08-12 05:43:32 +00:00
|
|
|
- release-v3.1
|
2018-01-10 18:13:36 +00:00
|
|
|
|
2019-02-04 05:31:43 +00:00
|
|
|
env:
|
|
|
|
global:
|
2020-02-17 12:15:57 +00:00
|
|
|
- GO111MODULE=on
|
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:
|
2020-06-22 11:36:23 +00:00
|
|
|
- export GOLANG_VERSION=$(source build.env ; echo ${GOLANG_VERSION})
|
|
|
|
- gimme ${GOLANG_VERSION}
|
|
|
|
- source ~/.gimme/envs/go${GOLANG_VERSION}.env
|
2019-11-07 09:55:12 +00:00
|
|
|
- mkdir -p $GOPATH/bin
|
2020-07-25 16:37:40 +00:00
|
|
|
# csi release to use for upgrade testing
|
|
|
|
- export UPGRADE_VERSION=$(source build.env ; echo ${UPGRADE_VERSION})
|
2019-02-04 05:31:43 +00:00
|
|
|
|
2019-12-18 10:29:08 +00:00
|
|
|
before_script:
|
2020-06-23 12:42:08 +00:00
|
|
|
- export CV=$(source build.env ; echo ${CEPH_VERSION})
|
2020-06-24 12:28:02 +00:00
|
|
|
- test -z "${CV}" || export GO_TAGS="-tags=${CV}"
|
2019-12-18 10:29:08 +00:00
|
|
|
- curl https://download.ceph.com/keys/release.asc | sudo apt-key add -
|
|
|
|
- sudo apt-add-repository
|
2020-06-23 12:42:08 +00:00
|
|
|
"deb https://download.ceph.com/debian-${CV} $(lsb_release -sc) main"
|
2019-12-18 10:29:08 +00:00
|
|
|
# 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
|
2020-07-09 06:59:13 +00:00
|
|
|
- sudo apt-get -y install conntrack
|
2019-12-18 10:29:08 +00:00
|
|
|
|
2020-04-28 09:50:03 +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.
|
|
|
|
# Only run the deploy stage on push (not pull_request) events.
|
|
|
|
stages:
|
|
|
|
- build testing
|
2020-08-06 06:11:10 +00:00
|
|
|
- upgrade testing
|
2020-04-28 09:50:03 +00:00
|
|
|
- name: deploy
|
|
|
|
if: type = push
|
|
|
|
|
2019-02-07 09:58:09 +00:00
|
|
|
jobs:
|
|
|
|
include:
|
2020-04-21 09:57:19 +00:00
|
|
|
- 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
|
2020-06-22 12:06:43 +00:00
|
|
|
- export GOLANGCI_VERSION=$(source build.env ; echo ${GOLANGCI_VERSION})
|
2019-03-04 03:46:31 +00:00
|
|
|
- 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
|
2020-06-22 12:39:35 +00:00
|
|
|
- export GOSEC_VERSION=$(source build.env ; echo ${GOSEC_VERSION})
|
2019-08-30 10:23:10 +00:00
|
|
|
- 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
|
2020-06-22 12:48:32 +00:00
|
|
|
- export HELM_VERSION=$(source build.env ; echo ${HELM_VERSION})
|
2020-04-13 07:03:08 +00:00
|
|
|
- curl -L https://git.io/get_helm.sh
|
2020-04-13 07:07:42 +00:00
|
|
|
| bash -s -- -v "${HELM_VERSION}"
|
2020-05-20 11:39:28 +00:00
|
|
|
# yamllint disable rule:line-length
|
|
|
|
- mkdir -p /opt/commitlint && pushd /opt/commitlint
|
|
|
|
&& npm init -y && npm install --save-dev @commitlint/travis-cli && popd
|
|
|
|
- export PATH=/opt/commitlint/node_modules/.bin:$PATH
|
2020-06-28 18:01:01 +00:00
|
|
|
# install pylint and prettytable.
|
|
|
|
# target python script requires python3 dependencies.
|
|
|
|
- sudo apt install python3-pip python3-prettytable python3-setuptools python3-wheel -y
|
|
|
|
- pip3 install pylint
|
|
|
|
# yamllint enable rule:line-length
|
2019-02-07 09:58:09 +00:00
|
|
|
script:
|
2020-05-20 11:39:28 +00:00
|
|
|
- commitlint-travis
|
2020-04-17 10:23:44 +00:00
|
|
|
- make go-lint
|
2020-05-14 10:28:14 +00:00
|
|
|
- make lint-extras
|
2020-04-17 10:23:44 +00:00
|
|
|
- make gosec
|
2020-06-22 14:48:41 +00:00
|
|
|
- make go-test TEST_COVERAGE=stdout GO_COVER_DIR=_output/
|
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:
|
2020-04-24 09:27:12 +00:00
|
|
|
- ./scripts/build-multi-arch-image.sh || travis_terminate 1;
|
2020-04-21 13:30:40 +00:00
|
|
|
|
2020-07-25 16:37:40 +00:00
|
|
|
- stage: upgrade testing
|
2020-08-11 09:45:11 +00:00
|
|
|
name: CephFS upgrade tesing with CSI v3.0.0
|
2020-07-25 16:37:40 +00:00
|
|
|
script:
|
|
|
|
- scripts/skip-doc-change.sh || travis_terminate 0;
|
|
|
|
- make image-cephcsi || travis_terminate 1;
|
|
|
|
- scripts/travis-functest.sh v1.18.5 --test-cephfs=true
|
|
|
|
--test-rbd=false --upgrade-testing=true
|
|
|
|
--upgrade-version="${UPGRADE_VERSION}" || travis_terminate 1;
|
|
|
|
|
|
|
|
- stage: upgrade testing
|
2020-08-11 09:45:11 +00:00
|
|
|
name: RBD upgrade tesing with CSI v3.0.0
|
2020-07-25 16:37:40 +00:00
|
|
|
script:
|
|
|
|
- scripts/skip-doc-change.sh || travis_terminate 0;
|
|
|
|
- make image-cephcsi || travis_terminate 1;
|
|
|
|
- scripts/travis-functest.sh v1.18.5 --test-cephfs=false
|
|
|
|
--test-rbd=true --upgrade-testing=true
|
|
|
|
--upgrade-version="${UPGRADE_VERSION}" || travis_terminate 1;
|
|
|
|
|
2020-04-28 09:50:03 +00:00
|
|
|
- stage: deploy
|
|
|
|
name: push artifacts to repositories
|
|
|
|
script: ./deploy.sh
|