
This change aims to add the airship-in-a-pod test to the gates. This is accomplished by creating new scripts to run which install a minimal k8s environment, and then apply the airship-in-a-pod.yaml. Brief description of scripts 01_dns_settings: Running k8s pods in zuul has a lot of issues with DNS resolution which this resolves. 10_install_minikube: grabs latest minikube and other dependencies. 11_build_images: builds the images under tools/airship-in-a-pod and then adds patches to the kustomize configuration to use and configure them. 12_start_minikube: starts minikube and makes sure kubectl will work 13_apply_dns.sh: This takes some of the effort from 01_dns_settings and incorporates it into the minikube cluster by modifying coredns 20_apply_aiap: Applies the airship-in-a-pod.yaml to the cluster. Has a few loops to check that the cluster is fully running before applying, and to check on the pod to see if it is ready before finishing. Closes: #478 Change-Id: I4c02d04b0eda9395642032bf56b56a0f823c1969
53 lines
1.9 KiB
Makefile
53 lines
1.9 KiB
Makefile
DOCKER_REGISTRY ?= quay.io
|
|
DOCKER_IMAGE_PREFIX ?= airshipit
|
|
DOCKER_IMAGE_TAG ?= latest
|
|
IMAGES ?= infra-builder runner
|
|
PUBLISH ?= false
|
|
|
|
.PHONY: help base libvirt artifact-setup $(IMAGES) images test
|
|
|
|
SHELL:=/bin/bash
|
|
.ONESHELL:
|
|
|
|
help: ## This help.
|
|
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
|
|
|
images: artifact-setup
|
|
images: base
|
|
images: libvirt
|
|
images: $(IMAGES) ## Build the containers.
|
|
|
|
artifact-setup:
|
|
docker build --tag $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/aiap-artifact-setup:$(DOCKER_IMAGE_TAG) --build-arg AIRSHIPCTL_REF=$(AIRSHIPCTL_REF) ./artifact-setup
|
|
ifeq (true, $(PUBLISH))
|
|
docker push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/aiap-artifact-setup:$(DOCKER_IMAGE_TAG)
|
|
endif
|
|
|
|
base:
|
|
docker build --tag $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/aiap-base:$(DOCKER_IMAGE_TAG) --build-arg BASE_IMAGE=ubuntu:20.04 ./base
|
|
ifeq (true, $(PUBLISH))
|
|
docker push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/aiap-base:$(DOCKER_IMAGE_TAG)
|
|
endif
|
|
|
|
libvirt:
|
|
docker build --tag $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/libvirt:$(DOCKER_IMAGE_TAG) ./libvirt
|
|
ifeq (true, $(PUBLISH))
|
|
docker push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/libvirt:$(DOCKER_IMAGE_TAG)
|
|
endif
|
|
|
|
$(IMAGES):
|
|
docker build --tag $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/aiap-$@:$(DOCKER_IMAGE_TAG) ./$@
|
|
ifeq (true, $(PUBLISH))
|
|
docker push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/aiap-$@:$(DOCKER_IMAGE_TAG)
|
|
endif
|
|
|
|
test: test-airshipctl test-treasuremap
|
|
|
|
test-airshipctl: images
|
|
kubectl delete pod airship-in-a-pod || true
|
|
kustomize build ./examples/airshipctl | kubectl apply -f -
|
|
|
|
test-treasuremap: images
|
|
kubectl delete pod airship-in-a-pod || true
|
|
kustomize build ./examples/airshipctl | kubectl apply -f -
|