forked from buildfarm/buildfarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTiltfile
59 lines (48 loc) · 2.33 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
53
54
55
56
57
58
59
# -*- mode: Python -*-
# This Tiltfile defines a complete dev environment for buildfarm.
# It automates all the steps from a code change to a new process:
# watching files, building container images, and bringing your environment up-to-date.
# Think docker build && kubectl apply or docker-compose up.
# Install: https://docs.tilt.dev/
# Run `tilt up`.
# Dependency for live-reload
load('./bazel.Tiltfile', 'bazel_sourcefile_deps')
# Overrides Tilt telemetry.
# By default, Tilt does not send telemetry.
# After you successfully run a Tiltfile, the Tilt web UI will nudge you to opt in or opt out of telemetry.
# This avoids that from happening.
analytics_settings(False)
# Inform tilt about the custom images built within the repository.
# When you change code, these images will be re-built and re-deployed.
custom_build(
ref='buildfarm-shard-worker-image',
command=(
'./bazelw build --javabase=@bazel_tools//tools/jdk:remote_jdk11 //:buildfarm-shard-worker.tar && ' +
'docker load < bazel-bin/buildfarm-shard-worker.tar && ' +
'docker tag bazel:buildfarm-shard-worker $EXPECTED_REF'
),
deps=bazel_sourcefile_deps('//:buildfarm-shard-worker.tar')
)
custom_build(
ref='buildfarm-server-image',
command=(
'./bazelw build --javabase=@bazel_tools//tools/jdk:remote_jdk11 //:buildfarm-server.tar && ' +
'docker load < bazel-bin/buildfarm-server.tar && ' +
'docker tag bazel:buildfarm-server $EXPECTED_REF'
),
deps=bazel_sourcefile_deps('//:buildfarm-server.tar')
)
local_resource("unit tests",'./bazelw test --javabase=@bazel_tools//tools/jdk:remote_jdk11 //src/test/...')
# Object definitions for kubernetes.
# Tilt will automatically correlate them to any above docker images.
k8s_yaml(local('./bazelw run //kubernetes/deployments:kubernetes'))
k8s_yaml(local('./bazelw run //kubernetes/deployments:server'))
k8s_yaml(local('./bazelw run //kubernetes/deployments:shard-worker'))
k8s_yaml(local('./bazelw run //kubernetes/deployments:redis-cluster'))
k8s_yaml(local('./bazelw run //kubernetes/services:redis-cluster'))
k8s_yaml(local('./bazelw run //kubernetes/services:shard-worker'))
# Expose endpoints outside the kubernetes cluster.
k8s_resource('kubernetes-dashboard', port_forwards=8443)
k8s_resource('shard-worker', port_forwards=8981)
k8s_resource('server', port_forwards=8980)
k8s_resource('redis-cluster', port_forwards=6379)