Skip to content

feat(configure): add repo_subdir support for monorepo deployments#14

Merged
hailangvn merged 3 commits intomainfrom
feat/repo-subdir
Apr 13, 2026
Merged

feat(configure): add repo_subdir support for monorepo deployments#14
hailangvn merged 3 commits intomainfrom
feat/repo-subdir

Conversation

@nilshamerlinck
Copy link
Copy Markdown
Contributor

Summary

  • Adds --repo-subdir CLI option to configure command
  • Adds repo_subdir key support in deploy.yml config
  • When set, the venv setup, .env copy, build command, WorkingDirectory, and venv_path all resolve relative to the subdirectory instead of the repo root
  • Git clone and gitaggregate still operate on the repo root (unchanged)

Example

With repo_subdir: python in deploy.yml (or --repo-subdir python), the generated unit becomes:

[Service]
Type=simple
WorkingDirectory=/opt/openerp/service-odoo-check-production/python
ExecStart=/opt/openerp/service-odoo-check-production/python/.venv/bin/python -m odoo_check.server

Test plan

  • Deploy a monorepo instance with --repo-subdir <subdir> and verify WorkingDirectory and ExecStart paths in the generated .service file
  • Deploy without --repo-subdir and verify existing behaviour is unchanged
  • Set repo_subdir in deploy.yml and verify it is picked up without the CLI flag
  • Run make check and make test — all pass

🤖 Generated with Claude Code

Adds --repo-subdir CLI option and repo_subdir config key so the service
root (WorkingDirectory, venv, exec_start probe) can target a subdirectory
of the cloned repo instead of the repo root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@hailangvn hailangvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change update command as well as in separated commit.

Comment on lines +140 to +143
executor.run(
"if [ -f addons/repos.yaml ]; then cd addons/ && gitaggregate -c repos.yaml; fi",
cwd=instance_path,
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hailangvn why not under eff_type == "odoo" only anymore?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In configure command the git aggregate is outside of eff_type so it should be same with update command. No?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better fix configure command then as this is odoo specific

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been fixed. Thank you.

Copy link
Copy Markdown
Contributor Author

@nilshamerlinck nilshamerlinck Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I think you can merge then

@hailangvn hailangvn merged commit ef9dffc into main Apr 13, 2026
5 checks passed
@hailangvn hailangvn deleted the feat/repo-subdir branch April 13, 2026 07:14
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