From b0bb37b6db59baa2ae5a8974f701a4919cb65be0 Mon Sep 17 00:00:00 2001 From: "roi.kramer" Date: Sun, 17 Jan 2021 11:10:09 +0200 Subject: [PATCH] initial commit --- .gitignore | 1 + Makefile | 6 ++++-- hack/prepare-procfile.sh | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 hack/prepare-procfile.sh diff --git a/.gitignore b/.gitignore index bfb7f0584df3..a3705d52d3c0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ git-ask-pass.sh /go-diagrams/ /.run/ pprof +__debug_bin diff --git a/Makefile b/Makefile index baf262f73fe8..0c714719a644 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,7 @@ K3D := $(shell if [[ "`which kubectl`" != '' ]] && [[ "`kubect LOG_LEVEL := debug UPPERIO_DB_DEBUG := 0 NAMESPACED := true +PROCFILE := $(shell EXCLUDE=$(EXCLUDE) ./hack/prepare-procfile.sh) ifeq ($(PROFILE),prometheus) RUN_MODE := kubernetes @@ -426,7 +427,8 @@ test-images: $(call docker_pull,python:alpine3.6) $(GOPATH)/bin/goreman: - go get github.com/mattn/goreman + # use GO111MODULE=off so it won't add this to go.mod + GO111MODULE=off go get github.com/mattn/goreman .PHONY: start ifeq ($(RUN_MODE),kubernetes) @@ -455,7 +457,7 @@ endif sleep 10s ./hack/port-forward.sh ifeq ($(RUN_MODE),local) - env DEFAULT_REQUEUE_TIME=$(DEFAULT_REQUEUE_TIME) SECURE=$(SECURE) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) LOG_LEVEL=$(LOG_LEVEL) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) VERSION=$(VERSION) AUTH_MODE=$(AUTH_MODE) NAMESPACED=$(NAMESPACED) NAMESPACE=$(KUBE_NAMESPACE) $(GOPATH)/bin/goreman -set-ports=false -logtime=false start + env DEFAULT_REQUEUE_TIME=$(DEFAULT_REQUEUE_TIME) SECURE=$(SECURE) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) LOG_LEVEL=$(LOG_LEVEL) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) VERSION=$(VERSION) AUTH_MODE=$(AUTH_MODE) NAMESPACED=$(NAMESPACED) NAMESPACE=$(KUBE_NAMESPACE) $(GOPATH)/bin/goreman -f $(PROCFILE) -set-ports=false -logtime=false start endif .PHONY: wait diff --git a/hack/prepare-procfile.sh b/hack/prepare-procfile.sh new file mode 100755 index 000000000000..34f25effe0b9 --- /dev/null +++ b/hack/prepare-procfile.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -eu -o pipefail -o nounset + +exclude=${EXCLUDE:-} + +if [[ -z ${exclude} ]]; then + echo "$PWD/Procfile" + exit 0 +fi + +tempfile=$(mktemp) +cat ./Procfile > $tempfile + +IFS=', ' read -r -a excluded <<< "$exclude" + +for PROC in "${excluded[@]}" +do + sed -i "" "/^$PROC/d" $tempfile + #cat $tempfile + #echo $filtered > $tempfile +done + +echo $tempfile \ No newline at end of file