Skip to content

Commit

Permalink
Merge pull request #95 from liferay/LXC-143-simplify
Browse files Browse the repository at this point in the history
LXC-143 simplify
  • Loading branch information
gamerson committed Nov 16, 2022
2 parents 582f289 + 6db0fda commit 6f02588
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions resources/tilt/Tiltfile.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ local_resource(
),
),
)

def on_down():
local("docker container stop %s" % db_container_name)
16 changes: 7 additions & 9 deletions scripts/ext/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,26 @@ def copy_partial(src, dst):
return shutil.copy2(src, dst)


is_partial = template_path.startswith(resources_base_path + "partial/")

if is_partial:
if template_path.startswith(resources_base_path + "partial/"):
shutil.copytree(
template_path + "/overwrite",
project_path,
copy_function=copy_partial if is_partial else shutil.copy2,
dirs_exist_ok=True if is_partial else False,
copy_function=copy_partial,
dirs_exist_ok=True,
)

shutil.copytree(
template_path + "/append",
project_path,
copy_function=copy_partial if is_partial else shutil.copy2,
dirs_exist_ok=True if is_partial else False,
copy_function=copy_partial,
dirs_exist_ok=True,
)
else:
shutil.copytree(
template_path,
project_path,
copy_function=copy_partial if is_partial else shutil.copy2,
dirs_exist_ok=True if is_partial else False,
copy_function=shutil.copy2,
dirs_exist_ok=False,
)

for root, dirs, files in os.walk(project_path):
Expand Down
7 changes: 6 additions & 1 deletion tilt/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def process_extension(
def workspace_search(pattern):
find_args = [
"find /workspace/client-extensions",
"-name %s" % pattern,
"-name '%s'" % pattern,
"-not -path '*/build/*'",
"-not -path '*/node_modules/*'",
"-not -path '*/node_modules_cache/*'",
Expand Down Expand Up @@ -148,6 +148,11 @@ if config.tilt_subcommand == "down":
local("kubectl delete cm -l lxc.liferay.com/metadataType=ext-init")
local("%s/scripts/dxp-stop.sh" % repo)

# check user tiltfiles for a "extension_stop()" hook
for user_tiltfile in user_tiltfiles:
if user_tiltfile.get("on_down"):
user_tiltfile["on_down"]()

# build and launch dxp

dxp_buildargs_val = ""
Expand Down

0 comments on commit 6f02588

Please sign in to comment.