forked from coredns/coredns
-
Notifications
You must be signed in to change notification settings - Fork 25
/
config.yml
65 lines (59 loc) · 1.88 KB
/
config.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
version: 2
initWorkingDir: &initWorkingDir
type: shell
name: Initialize Working Directory
pwd: /
command: |
mkdir -p ~/go/src/${CIRCLE_PROJECT_USERNAME}/coredns
sudo chown -R circleci ~/go
mkdir -p ~/go/out/tests
mkdir -p ~/go/out/logs
mkdir -p /home/circleci/logs
GOROOT=$(go env GOROOT)
sudo rm -r $(go env GOROOT)
sudo mkdir $GOROOT
LATEST=$(curl -s https://golang.org/VERSION?m=text)
curl https://dl.google.com/go/${LATEST}.linux-amd64.tar.gz | sudo tar xz -C $GOROOT --strip-components=1
integrationDefaults: &integrationDefaults
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/${CIRCLE_PROJECT_USERNAME}/coredns
environment:
- K8S_VERSION: v1.15.3
- KIND_VERSION: v0.5.1
- KUBECONFIG: /home/circleci/.kube/kind-config-kind
setupKubernetes: &setupKubernetes
- run:
name: Setup Kubernetes
command: ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci/build/kubernetes/k8s_setup.sh
buildCoreDNSImage: &buildCoreDNSImage
- run:
name: Build latest CoreDNS Docker image
command: |
cd ~/go/src/${CIRCLE_PROJECT_USERNAME}/coredns
make coredns SYSTEM="GOOS=linux" && \
docker build -t coredns . && \
kind load docker-image coredns
jobs:
kubernetes-tests:
<<: *integrationDefaults
steps:
- <<: *initWorkingDir
- checkout
- run:
name: Get CI repo
command : |
mkdir -p ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci
git clone https://github.com/${CIRCLE_PROJECT_USERNAME}/ci ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci
- <<: *setupKubernetes
- <<: *buildCoreDNSImage
- run:
name: Run Kubernetes tests
command: |
cd ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci/test/kubernetes
go test -v ./...
workflows:
version: 2
integration-tests:
jobs:
- kubernetes-tests