-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathTiltfile
More file actions
executable file
·72 lines (63 loc) · 1.95 KB
/
Tiltfile
File metadata and controls
executable file
·72 lines (63 loc) · 1.95 KB
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
66
67
68
69
70
71
72
#!/usr/bin/env python
load('ext://restart_process', 'docker_build_with_restart')
load('ext://color', 'color')
load('ext://dotenv', 'dotenv')
analytics_settings(True) # Enable telemetry dialogue in web UI
disable_snapshots() # Disable TiltCloud Snapshots
version_settings(True) # Enable 'new version' banner
# Load environment variables from .env file
dotenv()
allow_k8s_contexts('minikube')
# Build sv-publisher
custom_build(
ref='sv-dune:latest',
command=[
'./cluster/scripts/build_docker.sh',
'--dockerfile', './cluster/docker/sv-dune.Dockerfile'
],
deps=[
'./src',
'./Cargo.toml',
'./Cargo.lock',
'./cluster/docker/sv-dune.Dockerfile'
],
live_update=[
sync('./src', '/usr/src'),
sync('./Cargo.toml', '/usr/src/Cargo.toml'),
sync('./Cargo.lock', '/usr/src/Cargo.lock'),
run('cargo build', trigger=['./src', './Cargo.toml', './Cargo.lock'])
],
ignore=['./target']
)
# Deploy the Helm chart with values from .env
# Get deployment mode from environment variable, default to 'full'
config_mode = os.getenv('CLUSTER_MODE', 'full')
# Resource configurations
RESOURCES = {
'dune': {
'name': 'fuel-streams-sv-dune',
'ports': ['8080:8080'],
'labels': 'dune',
'config_mode': ['minimal', 'full'],
},
}
k8s_yaml(helm(
'cluster/charts/fuel-streams',
name='fuel-streams',
namespace='fuel-streams',
values=[
'cluster/charts/fuel-streams/values.yaml',
'cluster/charts/fuel-streams/values-local.yaml',
'cluster/charts/fuel-streams/values-secrets.yaml'
]
))
# Configure k8s resources
for name, resource in RESOURCES.items():
if config_mode in resource['config_mode']:
k8s_resource(
resource['name'],
new_name=name,
port_forwards=resource.get('ports', []),
resource_deps=resource.get('deps', []),
labels=resource['labels']
)