This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
65 lines (53 loc) · 2.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
ENV_FILE := .env
include ${ENV_FILE}
export $(shell sed 's/=.*//' ${ENV_FILE})
export PIPENV_DOTENV_LOCATION=${ENV_FILE}
oc_get_token:
oc sa get-token "prometheus" -n "${NAMESPACE}"
oc_create_build:
oc process --filename=openshift/prometheus-flatliner-image-build-template.yaml \
--param NAMESPACE=${NAMESPACE} \
| oc apply -f -
oc_build_head:
$(eval ARCHIVE=$(shell mktemp))
git archive --format=tar.gz HEAD > ${ARCHIVE}
oc start-build prometheus-flatliner --from-archive ${ARCHIVE} --follow
oc_trigger_build:
oc start-build prometheus-flatliner -F
oc_historic_job:
oc process --filename=openshift/prometheus-flatliner-job-template.yaml \
--param NAMESPACE=${NAMESPACE} \
--param FLT_PROM_URL=${FLT_PROM_URL} \
--param FLT_PROM_ACCESS_TOKEN="${FLT_PROM_ACCESS_TOKEN}" \
--param FLT_DEBUG_MODE="${FLT_DEBUG_MODE}" \
--param FLT_METRICS_LIST="${FLT_METRICS_LIST}" \
--param FLT_METRIC_START_DATETIME="${FLT_METRIC_START_DATETIME}" \
--param FLT_METRIC_END_DATETIME="${FLT_METRIC_END_DATETIME}" \
--param FLT_METRIC_CHUNK_SIZE="${FLT_METRIC_CHUNK_SIZE}" \
--param FLT_INFLUX_DB_DSN="${FLT_INFLUX_DB_DSN}" \
| oc apply -f -
oc_delete_historic_job:
oc delete all -l job_batch=prometheus-flatliner-historic-job
oc_deploy:
oc process --filename=openshift/prometheus-flatliner-deployment-template.yaml \
--param NAMESPACE=${NAMESPACE} \
--param FLT_PROM_URL=${FLT_PROM_URL} \
--param FLT_PROM_ACCESS_TOKEN="${FLT_PROM_ACCESS_TOKEN}" \
--param FLT_DEBUG_MODE="${FLT_DEBUG_MODE}" \
--param FLT_METRICS_LIST="${FLT_METRICS_LIST}" \
--param FLT_METRIC_START_DATETIME="${FLT_METRIC_START_DATETIME}" \
--param FLT_METRIC_CHUNK_SIZE="${FLT_METRIC_CHUNK_SIZE}" \
--param FLT_INFLUX_DB_DSN="${FLT_INFLUX_DB_DSN}" \
--param FLT_LIVE_METRIC_COLLECT="True" \
--param FLT_LIVE_METRIC_DELAY="${FLT_LIVE_METRIC_DELAY}" \
| oc apply -f -
oc_delete_live_deployment:
oc delete all -l app=prometheus-flatliner-live-deployment
run_app:
PIPENV_DOTENV_LOCATION=.env pipenv run python app.py
historic_job:
PIPENV_DOTENV_LOCATION=.env.historic pipenv run pytest
test:
PIPENV_DOTENV_LOCATION=.env.test pipenv run pytest
clear_influx:
PIPENV_DOTENV_LOCATION=.env pipenv run python clear_influx.py