@@ -16,11 +16,18 @@ DOCKER_REGISTRY = "localhost:63628/"
16
16
17
17
load ("ext://docker_build_sub" , "docker_build_sub" )
18
18
19
+ def get_profiles ():
20
+ profiles = os .getenv ('ONCALL_PROFILES' , 'grafana,plugin,backend,tests' )
21
+ return profiles .split (',' )
22
+ profiles = get_profiles ()
23
+
19
24
# Tell ops-devenv/Tiltifle where our plugin.json file lives
20
25
plugin_file = os .path .abspath ("grafana-plugin/src/plugin.json" )
21
26
22
27
def plugin_json ():
23
- return plugin_file
28
+ if 'plugin' in profiles :
29
+ return plugin_file
30
+ return 'NOT_A_PLUGIN'
24
31
25
32
26
33
allow_k8s_contexts (["kind-kind" ])
@@ -78,12 +85,13 @@ def load_grafana():
78
85
grafana_version = os .getenv ("GRAFANA_VERSION" , "latest" )
79
86
80
87
81
- k8s_resource (
82
- objects = ["grafana-oncall-app-provisioning:configmap" ],
83
- new_name = "grafana-oncall-app-provisioning-configmap" ,
84
- resource_deps = ["build-ui" ],
85
- labels = ["Grafana" ],
86
- )
88
+ if 'plugin' in profiles :
89
+ k8s_resource (
90
+ objects = ["grafana-oncall-app-provisioning:configmap" ],
91
+ new_name = "grafana-oncall-app-provisioning-configmap" ,
92
+ resource_deps = ["build-ui" ],
93
+ labels = ["Grafana" ],
94
+ )
87
95
88
96
# Use separate grafana helm chart
89
97
if not running_under_parent_tiltfile :
@@ -101,12 +109,6 @@ def load_grafana():
101
109
)
102
110
# --- GRAFANA END ----
103
111
104
-
105
- def get_profiles ():
106
- profiles = os .getenv ('ONCALL_PROFILES' , 'grafana,plugin,backend,tests' )
107
- return profiles .split (',' )
108
- profiles = get_profiles ()
109
-
110
112
if 'grafana' in profiles :
111
113
load_grafana ()
112
114
if 'plugin' in profiles :
0 commit comments