Skip to content

Commit ac627ea

Browse files
committed
Makefile repo base dir without git
1 parent 8eb2e73 commit ac627ea

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

scripts/common.Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ IS_WIN := $(strip $(if $(or $(IS_LINUX),$(IS_OSX),$(IS_WSL)),,$(OS)))
1616
$(if $(IS_WSL2),,$(if $(IS_WSL),$(error WSL1 is not supported in all recipes. Use WSL2 instead. Follow instructions in README.md),))
1717

1818
# Check that a valid location to a config file is set.
19-
REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)
19+
REPO_BASE_DIR := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))..)
2020
export REPO_CONFIG_LOCATION := $(shell cat $(REPO_BASE_DIR)/.config.location)
2121
$(if $(REPO_CONFIG_LOCATION),,$(error The location of the repo.config file given in .config.location is invalid. Aborting))
2222
$(if $(shell cat $(REPO_CONFIG_LOCATION)),,$(error The location of the repo.config file given in .config.location is invalid. Aborting))

services/monitoring/Makefile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# STACK_NAME defaults to name of the current directory. Should not to be changed if you follow GitOps operating procedures.
55
STACK_NAME = $(notdir $(CURDIR))
66
TEMP_COMPOSE=.stack.${STACK_NAME}.yaml
7-
REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)
7+
REPO_BASE_DIR := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))../..)
88

99
# TARGETS --------------------------------------------------
1010
include ${REPO_BASE_DIR}/scripts/common.Makefile
@@ -76,22 +76,13 @@ ${TEMP_COMPOSE}-local: docker-compose.yml docker-compose.letsencrypt.dns.yml con
7676
docker-compose.yml: docker-compose.yml.j2 .env .venv pgsql_query_exporter_config.yaml
7777
$(call jinja,$<,.env,$@)
7878

79-
.PHONY: update.grafana.pwd
80-
update.grafana.pwd: .env ## Change grafana pwd
81-
@set -o allexport; \
82-
source $(REPO_CONFIG_LOCATION); \
83-
set +o allexport; \
84-
grafanacontainerid=$$(docker ps | grep grafana | awk '{print $$1;}');\
85-
docker exec -ti $$grafanacontainerid grafana-cli admin reset-admin-password $$TRAEFIK_PASSWORD
86-
8779
.PHONY: grafana-import
8880
grafana-import: grafana/assets ## Imports the remote grafana dashboards and datasources FROM YOUR LOCAL MACHINE
8981
@pushd ${REPO_BASE_DIR}/services/monitoring/grafana && \
9082
$(MAKE) terraform-plan && \
9183
$(MAKE) terraform-apply; \
9284
popd > /dev/null
9385

94-
9586
.PHONY: config.grafana.dashboards
9687
config.grafana.dashboards: grafana/templates-provisioning/dashboards/simcore/Metrics-dashboard.json.j2 .venv #Configure dashboards for aws or dalco clusters
9788
$(call jinja, $<, .env, grafana/provisioning/dashboards/simcore/Metrics-dashboard.json)

services/monitoring/grafana/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DEFAULT_GOAL := help
2-
REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)
2+
REPO_BASE_DIR := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))../../..)
33
include ${REPO_BASE_DIR}/scripts/common.Makefile
44

55

0 commit comments

Comments
 (0)