Skip to content
Open
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
2 changes: 1 addition & 1 deletion frappe_deployer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from frappe_deployer.consts import LOG_FILE_NAME
import typer

VERSION = "0.12.1"
VERSION = "0.12.2"

def version_callback(show: bool):

Expand Down
37 changes: 25 additions & 12 deletions frappe_deployer/deployment_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,8 +1468,6 @@ def bench_build(self, bench_directory: BenchDirectory):
apps = [d for d in bench_directory.apps.iterdir() if d.is_dir()]

for app in apps:
self.printer.change_head(f"Building app {app.name}")

# Find corresponding AppConfig for the app to check for pre/post build commands
app_config = None
for config in self.apps:
Expand All @@ -1495,16 +1493,31 @@ def bench_build(self, bench_directory: BenchDirectory):
custom_workdir=app_dir_path,
)

# Run the regular build command
build_cmd = [self.bench_cli, "build", "--app", app.name]
prod_build_cmd = [
self.bench_cli,
"build",
"--production",
"--force",
]

self.host_run(
build_cmd,
bench_directory,
# stream=False,
container=self.mode == "fm",
capture_output=False,
)
self.host_run(
prod_build_cmd,
bench_directory,
container=self.mode == "fm",
capture_output=False,
)

for app in apps:
# Find corresponding AppConfig for the app to check for pre/post build commands
app_config = None
for config in self.apps:
app_name = bench_directory.get_app_python_module_name(bench_directory.apps / config.dir_name)
if app_name == app.name:
app_config = config
break

# Define app directory path for container
app_dir_path = f"/workspace/{bench_directory.path.name}/apps/{app.name}"

# Run post-build command if configured and in FM mode
if self.mode == "fm" and app_config and app_config.fm_post_build:
Expand All @@ -1520,7 +1533,7 @@ def bench_build(self, bench_directory: BenchDirectory):
custom_workdir=app_dir_path,
)

self.printer.print(f"Built app {app.name}")
# self.printer.print(f"Built app {app.name}")

self.printer.print("Built all apps")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "frappe-deployer"
version = "0.12.1"
version = "0.12.2"
description = "Automates setup and management of Frappe/Frappe-Manager environments using flags or config file."
authors = ["Alok Singh <[email protected]>"]
license = "MIT"
Expand Down
Loading