diff --git a/.travis.yml b/.travis.yml index bf28434..4872c41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,30 +1,26 @@ +dist: trusty +sudo: required + language: go branches: except: - gh-pages +matrix: + include: + - env: CEPH_RELEASE=jewel + - env: CEPH_RELEASE=kraken + before_install: - - ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N '' - - cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys - - chmod 600 ~/.ssh/authorized_keys - - sudo pip install ceph-deploy - - ceph-deploy install --release giant `hostname` - - ceph-deploy pkg --install librados-dev `hostname` - - ceph-deploy pkg --install librbd-dev `hostname` - - ceph-deploy pkg --install libcephfs-dev `hostname` + - sudo apt-get update + - ci/before_install.sh - bash ci/micro-osd.sh /tmp/micro-ceph - export CEPH_CONF=/tmp/micro-ceph/ceph.conf - ceph status script: - - go get -t -v ./... - - go test -v ./... - - go fmt ./... - -notifications: - recipients: - - noahwatkins@gmail.com - email: - on_success: always - on_failure: always + - go get -t -v ./... + - go list ./... + - go test -v $(go list ./... | grep -v cephfs) + - go fmt ./... diff --git a/ci/before_install.sh b/ci/before_install.sh new file mode 100755 index 0000000..1823499 --- /dev/null +++ b/ci/before_install.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e +set -x + +sudo apt-get install -y python-virtualenv + +# ceph-deploy and ceph + +WORKDIR=$HOME/workdir +mkdir $WORKDIR +pushd $WORKDIR + +ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N '' +cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys +chmod 600 ~/.ssh/authorized_keys + +git clone git://github.com/ceph/ceph-deploy +pushd ceph-deploy +./bootstrap +./ceph-deploy install --release ${CEPH_RELEASE} `hostname` +./ceph-deploy pkg --install librados-dev `hostname` +./ceph-deploy pkg --install librbd-dev `hostname` +./ceph-deploy pkg --install libcephfs-dev `hostname` +popd # ceph-deploy + +popd # workdir diff --git a/ci/micro-osd.sh b/ci/micro-osd.sh index 62a158a..25a9dbd 100644 --- a/ci/micro-osd.sh +++ b/ci/micro-osd.sh @@ -100,10 +100,19 @@ ceph osd pool create cephfs_metadata 8 ceph fs new cephfs cephfs_metadata cephfs_data ceph-mds -i a +export CEPH_CONF="${DIR}/ceph.conf" + +while true; do + if ceph status | tee /dev/tty | grep -q HEALTH_OK; then + if ! ceph status | grep -q creating &> /dev/null; then + break + fi + fi + sleep 1 +done + # check that it works rados --pool rbd put group /etc/group rados --pool rbd get group ${DIR}/group diff /etc/group ${DIR}/group ceph osd tree - -export CEPH_CONF="${DIR}/ceph.conf"