mirror of
https://github.com/notherealmarco/coredns-deployment.git
synced 2025-03-14 14:16:16 +01:00
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
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
|
|
LATEST=$(curl -s https://go.dev/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}/deployment
|
|
environment:
|
|
- K8S_VERSION: v1.22.0
|
|
- KUBECONFIG: /home/circleci/.kube/kind-config-kind
|
|
- KIND_VERSION: v0.11.1
|
|
|
|
setupKubernetes: &setupKubernetes
|
|
- run:
|
|
name: Setup Kubernetes
|
|
command: ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci/build/kubernetes/k8s_setup.sh
|
|
|
|
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
|
|
- run:
|
|
name: Clone CoreDNS repo
|
|
command: |
|
|
mkdir -p ~/go/src/${CIRCLE_PROJECT_USERNAME}/coredns
|
|
git clone https://github.com/${CIRCLE_PROJECT_USERNAME}/coredns ~/go/src/${CIRCLE_PROJECT_USERNAME}/coredns
|
|
- <<: *setupKubernetes
|
|
- run:
|
|
name: Run Kubernetes deployment tests
|
|
command: |
|
|
cd ~/go/src/${CIRCLE_PROJECT_USERNAME}/ci/test/k8sdeployment
|
|
go mod tidy
|
|
GO111MODULE=on go test -v ./...
|
|
|
|
workflows:
|
|
version: 2
|
|
integration-tests:
|
|
jobs:
|
|
- k8s-deployment-tests
|