forked from tidepool-org/development
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile.mongodb
35 lines (26 loc) · 998 Bytes
/
Tiltfile.mongodb
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
load('./Tiltfile.global', 'getNested', 'getConfig')
### Config Start ###
config = getConfig()
mongo_helm_chart_dir = "./charts/mongo"
### Config End ###
### Main Start ###
def main():
# Provision the gloo gateway service
provisionMongoDB()
# Back out of actual provisioning for debugging purposes by uncommenting below
# fail('NOT YET ;)')
### Main End ###
### MongoDB Start ###
def provisionMongoDB ():
mongodb_data_dir = getNested(config, 'mongodb.hostPath')
mongo_helm_template_cmd = 'helm template --name tilt-mongodb --namespace default '
if mongodb_data_dir:
mongo_helm_template_cmd += '--set "mongodb.hostPath={}" '.format(mongodb_data_dir)
k8s_yaml(local(mongo_helm_template_cmd + mongo_helm_chart_dir))
# Expose mongodb on a host port
mongodb_port_forwards = getNested(config,'mongodb.portForwards', ['27017'])
k8s_resource('mongodb', port_forwards=mongodb_port_forwards)
watch_file(mongo_helm_chart_dir)
### MongoDB End ###
# Unleash the beast
main()