Skip to content

Commit

Permalink
Run CI using kind (EnMasseProject#4843)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Lilleengen authored Jun 29, 2020
1 parent e84922b commit f55c2fa
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 22 deletions.
16 changes: 3 additions & 13 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,11 @@ set -e

echo "${VERSION}"

echo "Make"
make

echo "Build"
make docker_build

if [[ -v PUSH_REGISTRY ]]
then
echo "Logging in to registry"
docker login -u "${REGISTRY_USER}" -p "${REGISTRY_PASS}" "${DOCKER_REGISTRY}"
make TAG="${VERSION}" docker_tag docker_push
make TAG="${VERSION}" buildpush
else
make IMAGE_PULL_POLICY=IfNotPresent buildpushkind
fi

echo "Push to registry"
make -j 4 docker_tag docker_push

echo "Generate templates"
make templates
26 changes: 26 additions & 0 deletions .github/scripts/setup_kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.8.1/kind-$(uname)-amd64"
chmod +x ./kind

cat <<EOF | ./kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
kubectl patch deployment ingress-nginx-controller -n ingress-nginx --type=json -p '[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--enable-ssl-passthrough"}]'
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
- name: setup-docker
run: ./.github/scripts/setup_docker.sh

- name: Minikube setup with registry
uses: EnMasseProject/[email protected]
- name: setup-kind
run: ./.github/scripts/setup_kind.sh

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
- name: setup-docker
run: ./.github/scripts/setup_docker.sh

- name: Minikube setup with registry
uses: EnMasseProject/[email protected]
- name: setup-kind
run: ./.github/scripts/setup_kind.sh

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: setup-docker
run: ./.github/scripts/setup_docker.sh

- name: Minikube setup with registry
uses: EnMasseProject/[email protected]
- name: setup-kind
run: ./.github/scripts/setup_kind.sh

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ coverage_go:
buildpush:
$(MAKE)
$(MAKE) docker_build
$(MAKE) docker_tag
$(MAKE) docker_push
$(MAKE) -j 4 docker_tag
$(MAKE) -j 4 docker_push

buildpushkind:
$(MAKE)
$(MAKE) docker_build
$(MAKE) docker_tag
$(MAKE) -j 4 docker_tag
$(MAKE) kind_load_image

clean_java:
Expand Down

0 comments on commit f55c2fa

Please sign in to comment.