Skip to content

feat(build): Enable local dev build#705

Merged
crocodilestick merged 2 commits intocrocodilestick:mainfrom
jgoguen:local-build-improvements
Oct 27, 2025
Merged

feat(build): Enable local dev build#705
crocodilestick merged 2 commits intocrocodilestick:mainfrom
jgoguen:local-build-improvements

Conversation

@jgoguen
Copy link
Contributor

@jgoguen jgoguen commented Oct 20, 2025

Updates the build script to add CLI flags for a local build. This will use the existing checked-out repo instead of cloning the repo fresh, for building images for development and testing before code is ready to push up.

Also adds CLI flags for the different things the script asks for, mostly as a convenience for people like me who might just re-run the build with some things always the same. I added flags for all of them, just seemed silly to only cover some of them, and the default behavior is the same as it is today.

Having flags for values let me shuffle some code around to better reflect what's happening. If a user is provided, for example, there's no point asking for it again or getting the default user.

And I added a .editorconfig file, to avoid whitespace-only changes. I took a guess at line width values.

Updates the build script to add CLI flags for a local build. This will
use the existing checked-out repo instead of cloning the repo fresh, for
building images for development and testing before code is ready to push
up.

Also adds CLI flags for the different things the script asks for, mostly
as a convenience for people like me who might just re-run the build with
some things always the same. I added flags for all of them, just seemed
silly to only cover some of them, and the default behavior is the same
as it is today.

Having flags for values let me shuffle some code around to better
reflect what's happening. If a user is provided, for example, there's no
point asking for it again or getting the default user.

And I added a .editorconfig file, to avoid whitespace-only changes. I
took a guess at line width values.
@jgoguen jgoguen force-pushed the local-build-improvements branch from dc36f35 to 9364773 Compare October 27, 2025 01:09
Fixed a couple issues with the local build mode:
- dirname was returning relative paths which broke when running the script from different locations. Now properly resolves to absolute path
- Added error handling for the cd command so it doesn't silently fail if something goes wrong

Also bumped Python line length in editorconfig from 88 to 120 since the existing codebase already has tons of lines over 88 chars anyway. Should cut down on unnecessary warnings.
@crocodilestick crocodilestick merged commit 142f1fc into crocodilestick:main Oct 27, 2025
4 checks passed
@crocodilestick
Copy link
Owner

Thank you so much for this! Great work! I've also added a page to the CWA Wiki explaining the script and how to use it, please give it a quick look over if you get the chance :) https://github.com/crocodilestick/Calibre-Web-Automated/wiki/Building-Custom-Docker-Images

@jgoguen
Copy link
Contributor Author

jgoguen commented Oct 27, 2025

Looks good, thanks!

@jgoguen jgoguen deleted the local-build-improvements branch October 28, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants