-
Notifications
You must be signed in to change notification settings - Fork 4
/
Tiltfile
52 lines (44 loc) · 1.74 KB
/
Tiltfile
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
allow_k8s_contexts('cluster-admin@sbernauer-demo-oidc')
# If tilt_options.json exists read it and load the default_registry value from it
settings = read_json('tilt_options.json', default={})
registry = settings.get('default_registry', 'docker.stackable.tech/sandbox')
# Configure default registry either read from config file above, or with default value of "docker.stackable.tech/sandbox"
default_registry(registry)
# meta = read_json('nix/meta.json')
# operator_name = meta['operator']['name']
operator_name = 'trino-lb'
custom_build(
registry + '/' + operator_name,
'nix shell -f . crate2nix -c crate2nix generate && nix-build . -A docker --argstr dockerName "${EXPECTED_REGISTRY}/' + operator_name + '" && ./result/load-image | docker load',
deps=['trino-lb', 'trino-lb-persistence', 'trino-lb-core', 'Cargo.toml', 'Cargo.lock', 'self_signed_certs', 'default.nix', 'nix'],
ignore=['*.~undo-tree~'],
# ignore=['result*', 'Cargo.nix', 'target', *.yaml],
outputs_image_ref_to='result/ref',
)
helm = helm(
'deploy/helm/' + operator_name,
name=operator_name,
namespace="trino-lb",
set=[
'image.repository=' + registry + '/' + operator_name,
],
)
k8s_yaml(helm)
# # Load the latest CRDs from Nix
# watch_file('result')
# if os.path.exists('result'):
# k8s_yaml('result/crds.yaml')
# # Exclude stale CRDs from Helm chart, and apply the rest
# helm_crds, helm_non_crds = filter_yaml(
# helm(
# 'deploy/helm/' + operator_name,
# name=operator_name,
# namespace="stackable-operators",
# set=[
# 'image.repository=' + registry + '/' + operator_name,
# ],
# ),
# api_version = "^apiextensions\\.k8s\\.io/.*$",
# kind = "^CustomResourceDefinition$",
# )
# k8s_yaml(helm_non_crds)