2016-07-27 10:01:24 -07:00
|
|
|
sudo: required
|
|
|
|
|
# Trusty distribution is much faster when sudo is required
|
|
|
|
|
dist: trusty
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
- docker
|
|
|
|
|
|
2016-03-18 20:57:35 +00:00
|
|
|
language: go
|
|
|
|
|
go:
|
2017-03-19 09:12:18 +00:00
|
|
|
- 1.8
|
2016-07-27 10:01:24 -07:00
|
|
|
|
2017-02-21 22:51:47 -08:00
|
|
|
go_import_path: github.com/coredns/coredns
|
2016-09-26 14:22:07 +08:00
|
|
|
|
2016-09-27 07:57:04 +08:00
|
|
|
env:
|
2016-10-20 11:06:15 -07:00
|
|
|
- ETCD_VERSION=2.3.1 K8S_VERSION=1.3.7 KUBECTL="docker exec hyperkube /hyperkube kubectl" DNS_ARGUMENTS=""
|
2016-09-27 07:57:04 +08:00
|
|
|
|
2016-07-27 10:01:24 -07:00
|
|
|
# In the Travis VM-based build environment, IPv6 networking is not
|
|
|
|
|
# enabled by default. The sysctl operations below enable IPv6.
|
|
|
|
|
# IPv6 is needed by some of the CoreDNS test cases. The VM environment
|
2016-08-19 17:14:17 -07:00
|
|
|
# is needed to have access to sudo in the test environment. Sudo is
|
2016-07-27 10:01:24 -07:00
|
|
|
# needed to have docker in the test environment. Docker is needed to
|
|
|
|
|
# launch a kubernetes instance in the test environment.
|
|
|
|
|
# (Dependencies are fun! :) )
|
|
|
|
|
before_install:
|
|
|
|
|
- cat /proc/net/if_inet6
|
|
|
|
|
- uname -a
|
|
|
|
|
- sudo bash -c 'if [ `cat /proc/net/if_inet6 | wc -l` = "0" ]; then echo "Enabling IPv6" ; sysctl net.ipv6.conf.all.disable_ipv6=0 ; sysctl net.ipv6.conf.default.disable_ipv6=0 ; sysctl net.ipv6.conf.lo.disable_ipv6=0 ; fi'
|
|
|
|
|
- cat /proc/net/if_inet6
|
|
|
|
|
- env
|
|
|
|
|
|
2016-04-10 18:50:11 +01:00
|
|
|
before_script:
|
2016-09-27 07:57:04 +08:00
|
|
|
- docker run -d --net=host --name=etcd quay.io/coreos/etcd:v$ETCD_VERSION
|
2016-11-14 19:31:08 +00:00
|
|
|
- docker run -d --volume=/:/rootfs:ro --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:rw --volume=/var/lib/kubelet/:/var/lib/kubelet:rw --volume=/var/run:/var/run:rw --volume=`pwd`/.travis:/travis --net=host --pid=host --privileged --name=hyperkube gcr.io/google_containers/hyperkube-amd64:v$K8S_VERSION /hyperkube kubelet --containerized --hostname-override=127.0.0.1 --api-servers=http://localhost:8080 --config=/etc/kubernetes/manifests $DNS_ARGUMENTS --allow-privileged --v=2
|
2016-10-20 11:06:15 -07:00
|
|
|
# Wait until kubectl is ready
|
|
|
|
|
- for i in {1..10}; do $KUBECTL version && break || sleep 5; done
|
|
|
|
|
- $KUBECTL version
|
|
|
|
|
- $KUBECTL config set-cluster test-doc --server=http://localhost:8080
|
|
|
|
|
- $KUBECTL config set-context test-doc --cluster=test-doc
|
|
|
|
|
- $KUBECTL config use-context test-doc
|
|
|
|
|
# Wait until k8s is ready
|
|
|
|
|
- for i in {1..30}; do $KUBECTL get nodes && break || sleep 5; done
|
2016-11-14 19:31:08 +00:00
|
|
|
- $KUBECTL create -f /travis/kubernetes/dns-test.yaml
|
2016-10-20 11:06:15 -07:00
|
|
|
- docker ps -a
|
2016-07-27 10:01:24 -07:00
|
|
|
|
2016-03-19 14:55:26 +00:00
|
|
|
script:
|
2016-09-26 14:22:48 +08:00
|
|
|
- make coverage
|
2016-09-18 11:01:57 -07:00
|
|
|
|
|
|
|
|
after_success:
|
|
|
|
|
- bash <(curl -s https://codecov.io/bash)
|