This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTiltfile-setup-dependencies
67 lines (57 loc) · 2.55 KB
/
Tiltfile-setup-dependencies
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
load('ext://namespace', 'namespace_create', 'namespace_inject')
settings = read_json('../tilt-settings.json', default={})
if settings.get("allow_k8s_contexts"):
allow_k8s_contexts(settings.get("allow_k8s_contexts"))
# Allows a maximum of one resources to update
update_settings (max_parallel_updates = 1)
operator_namespace= "rh-openshift-pipelines-operator"
instance_namespace= "rh-openshift-pipelines-instance"
# Create pipelines operator namespace
namespace_create(operator_namespace)
k8s_resource(
objects=['rh-openshift-pipelines-operator:namespace'],
new_name='operator_namespace'
)
# Install Pipelines Operator chart
local_resource(
'rh-openshift-pipelines-operator',
cmd='helm install rh-openshift-pipelines-operator oci://ghcr.io/stakater/charts/rh-openshift-pipelines-operator -n {}'.format(operator_namespace),
resource_deps=[
'operator_namespace'
])
# Wait until Pipelines Operator deployment is in available state
local_resource(
'wait-for-pipelines-operator-installation',
cmd="timeout 300s bash -c 'until kubectl wait --for condition=available deployment/openshift-pipelines-operator -n rh-openshift-pipelines-operator; do sleep 10; done'",
resource_deps=[
'rh-openshift-pipelines-operator'
])
# Create pipelines instance namespace # pod-security.kubernetes.io/enforce: privileged
namespace_create(instance_namespace)
k8s_resource(
objects=['rh-openshift-pipelines-instance:namespace'],
new_name='instance_namespace',
resource_deps=[
'wait-for-pipelines-operator-installation'
])
# Install Pipelines Instance chart, a tektonConfig CR which installs Tekton CRDs
local_resource(
'rh-openshift-pipelines-instance',
cmd='helm install rh-openshift-pipelines-instance oci://ghcr.io/stakater/charts/rh-openshift-pipelines-instance -n {}'.format(instance_namespace),
resource_deps=[
'instance_namespace'
])
# Wait until all tektonConfig resources are available
local_resource(
'wait-for-pipelines-instance-installation',
cmd='timeout 600s bash -c "until kubectl wait --for condition=Ready tektonconfig/config; do sleep 10; done"',
resource_deps=[
'rh-openshift-pipelines-instance'
])
# Wait until ClusterTask CRD becomes available before creating CRs
local_resource(
'wait-for-crds',
cmd='timeout 300s bash -c "until kubectl wait --for condition=Established crd/clustertasks.tekton.dev && kubectl wait --for condition=Established crd/taskruns.tekton.dev; do sleep 10; done"',
resource_deps=[
'wait-for-pipelines-instance-installation'
])