From f4ca69311c103652d16eea2521f82c31da5de6a8 Mon Sep 17 00:00:00 2001 From: Igor Sutton Date: Thu, 13 Dec 2018 14:23:46 +0100 Subject: [PATCH] Makefile and friends: move webhook related files to hack/webhook and Kubernetes files to kubernetes/ The Makefile now has targets to build both shipper and shipper-state-metrics. Paths of supporting files have been adjusted as well. --- Makefile | 20 +++++++++++++------ .../webhook/webhook-create-signed-cert.sh | 0 .../webhook/webhook-patch-ca-bundle.sh | 0 .../shipper.deployment.yaml | 0 .../shipper.service.yaml | 0 .../validating-webhook-configuration.yaml | 0 6 files changed, 14 insertions(+), 6 deletions(-) rename webhook-create-signed-cert.sh => hack/webhook/webhook-create-signed-cert.sh (100%) rename webhook-patch-ca-bundle.sh => hack/webhook/webhook-patch-ca-bundle.sh (100%) rename shipper.deployment.yaml => kubernetes/shipper.deployment.yaml (100%) rename shipper.service.yaml => kubernetes/shipper.service.yaml (100%) rename validating-webhook-configuration.yaml => kubernetes/validating-webhook-configuration.yaml (100%) diff --git a/Makefile b/Makefile index ac5af60f8..fe24aa0b4 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,28 @@ SHIPPER_NAMESPACE = shipper-system KUBECTL = kubectl -n $(SHIPPER_NAMESPACE) -build: - GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -o shipper cmd/shipper/main.go - docker build -f Dockerfile.shipper -t localhost:32000/shipper:latest --build-arg BASE_IMAGE=alpine:3.8 --build-arg HTTP_PROXY=$(HTTP_PROXY) --build-arg HTTPS_PROXY=$(HTTPS_PROXY) . +.PHONY: shipper + +shipper: + GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -o build/shipper ./cmd/shipper/*.go + docker build -f Dockerfile.shipper -t localhost:32000/shipper:latest --build-arg HTTP_PROXY=$(HTTP_PROXY) --build-arg HTTPS_PROXY=$(HTTPS_PROXY) . docker push localhost:32000/shipper:latest +shipper-state-metrics: + GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -o build/shipper-state-metrics ./cmd/shipper-state-metrics/*.go + docker build -f Dockerfile.metrics -t localhost:32000/shipper-state-metrics:latest --build-arg HTTP_PROXY=$(HTTP_PROXY) --build-arg HTTPS_PROXY=$(HTTPS_PROXY) . + docker push localhost:32000/shipper-state-metrics:latest + restart: $(KUBECTL) get po -o jsonpath='{.items[*].metadata.name}' | xargs $(KUBECTL) delete po certs: - ./webhook-create-signed-cert.sh --namespace $(SHIPPER_NAMESPACE) + ./hack/webhook/webhook-create-signed-cert.sh --namespace $(SHIPPER_NAMESPACE) install: - $(KUBECTL) apply -f shipper.service.yaml - $(KUBECTL) apply -f shipper.deployment.yaml + $(KUBECTL) apply -f kubernetes/shipper.service.yaml + $(KUBECTL) apply -f kubernetes/shipper.deployment.yaml + cat kubernetes/validating-webhook-configuration.yaml | hack/webhook/webhook-patch-ca-bundle.sh | $(KUBECTL) apply -f - logs: $(KUBECTL) get po -o jsonpath='{.items[*].metadata.name}' | xargs $(KUBECTL) logs --follow diff --git a/webhook-create-signed-cert.sh b/hack/webhook/webhook-create-signed-cert.sh similarity index 100% rename from webhook-create-signed-cert.sh rename to hack/webhook/webhook-create-signed-cert.sh diff --git a/webhook-patch-ca-bundle.sh b/hack/webhook/webhook-patch-ca-bundle.sh similarity index 100% rename from webhook-patch-ca-bundle.sh rename to hack/webhook/webhook-patch-ca-bundle.sh diff --git a/shipper.deployment.yaml b/kubernetes/shipper.deployment.yaml similarity index 100% rename from shipper.deployment.yaml rename to kubernetes/shipper.deployment.yaml diff --git a/shipper.service.yaml b/kubernetes/shipper.service.yaml similarity index 100% rename from shipper.service.yaml rename to kubernetes/shipper.service.yaml diff --git a/validating-webhook-configuration.yaml b/kubernetes/validating-webhook-configuration.yaml similarity index 100% rename from validating-webhook-configuration.yaml rename to kubernetes/validating-webhook-configuration.yaml