2019-06-19 18:50:48 +02:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
initWorkingDir: &initWorkingDir
|
|
|
|
type: shell
|
|
|
|
name: Initialize Working Directory
|
|
|
|
pwd: /
|
|
|
|
command: |
|
|
|
|
mkdir -p ~/go/src/${CIRCLE_PROJECT_USERNAME}/deployment
|
|
|
|
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
|
2021-12-21 17:54:32 +01:00
|
|
|
LATEST=$(curl -s https://go.dev/VERSION?m=text)
|
2020-04-24 18:27:57 +02:00
|
|
|
curl https://dl.google.com/go/${LATEST}.linux-amd64.tar.gz | sudo tar xz -C $GOROOT --strip-components=1
|
2019-06-19 18:50:48 +02:00
|
|
|
|
|
|
|
integrationDefaults: &integrationDefaults
|
|
|
|
machine:
|
|
|
|
image: ubuntu-1604:201903-01
|
|
|
|
working_directory: ~/go/src/${CIRCLE_PROJECT_USERNAME}/deployment
|
|
|
|
environment:
|
2021-11-01 16:28:40 +01:00
|
|
|
- K8S_VERSION: v1.22.0
|
2019-09-10 19:23:30 +02:00
|
|
|
- KUBECONFIG: /home/circleci/.kube/kind-config-kind
|
2021-11-01 16:28:40 +01:00
|
|
|
- KIND_VERSION: v0.11.1
|
2019-06-19 18:50:48 +02:00
|
|
|
|
|
|
|
setupKubernetes: &setupKubernetes
|
|
|
|
- run:
|
|
|
|
name: Setup Kubernetes
|
2019-09-10 19:23:30 +02:00
|
|
|
command: ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci/build/kubernetes/k8s_setup.sh
|
2019-06-19 18:50:48 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
k8s-deployment-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
|
2019-07-29 19:22:02 +02:00
|
|
|
- run:
|
2019-07-29 20:09:11 +02:00
|
|
|
name: Clone CoreDNS repo
|
2019-07-29 19:22:02 +02:00
|
|
|
command: |
|
|
|
|
mkdir -p ~/go/src/${CIRCLE_PROJECT_USERNAME}/coredns
|
|
|
|
git clone https://github.com/${CIRCLE_PROJECT_USERNAME}/coredns ~/go/src/${CIRCLE_PROJECT_USERNAME}/coredns
|
2019-06-19 18:50:48 +02:00
|
|
|
- <<: *setupKubernetes
|
|
|
|
- run:
|
|
|
|
name: Run Kubernetes deployment tests
|
|
|
|
command: |
|
|
|
|
cd ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci/test/k8sdeployment
|
2021-07-06 14:40:36 +02:00
|
|
|
go mod tidy
|
2019-06-19 18:50:48 +02:00
|
|
|
GO111MODULE=on go test -v ./...
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
integration-tests:
|
|
|
|
jobs:
|
|
|
|
- k8s-deployment-tests
|