Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tilt build fix #753

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tilt/io/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ def dir_create(path):
"""
local("mkdir -p {}".format(path),echo_off=True,quiet=True)

def prepare_file(path):
"""Prepare file for writing"""

local("echo '' > {}".format(path))

def file_write(path, contents):
"""Write contents to a file

Expand All @@ -17,7 +22,7 @@ def file_write(path, contents):
contents: The contents of the file

"""
local('echo "$CONTENTS" > {}'.format(path),
local('echo "$CONTENTS" >> {}'.format(path),
env={'CONTENTS': str(contents)},
echo_off=True,
quiet=True)
Expand Down
6 changes: 4 additions & 2 deletions tilt/project/Tiltfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- mode: Python -*-

load("../k8s/Tiltfile", "k8s_find_object_name")
load("../io/Tiltfile", "info", "file_write", "dir_create")
load("../io/Tiltfile", "info", "file_write", "dir_create", "prepare_file")

def project_enable(name, project, debug):
"""Enable a project in Tilt
Expand Down Expand Up @@ -70,7 +70,9 @@ def project_enable(name, project, debug):
yaml = kustomize(context + '/' + kustomize_dir)
yaml = update_manager(yaml, "manager", debug, env)
yaml_path = context + "/.tiltbuild/manifest.yaml"
file_write(yaml_path, yaml)
prepare_file(yaml_path)
for line in str(yaml).splitlines():
file_write(yaml_path, line)
k8s_yaml(yaml)

objs = decode_yaml_stream(yaml)
Expand Down