Add build helper script - #4
Open
simhue wants to merge 2 commits into
Open
Conversation
akomii
requested changes
Oct 1, 2024
| # minimizes build time | ||
| # alternatively if the start project is empty and the script is called from a project folder, it uses that project as entry point | ||
| # otherwise it builds every project | ||
| start_project = "" |
Member
There was a problem hiding this comment.
I dont understand this. What is the purpose of this script and how do I use it. Does it need to be in a specific folder? Does it need to be configured? If yes, it would be easier to provide the configuration as input arguments, like
python build_projects.py <dwh_projects_root> <start_project>
| os.makedirs(dwh_projects_root) | ||
|
|
||
| # get DWH central project if not exists and get the names of all child projects | ||
| if not os.path.exists(os.path.join(aktin_project_path, "pom.xml")): |
Member
There was a problem hiding this comment.
Again, the context is missing. Why does the script do that?
| project_path = os.path.join(dwh_projects_root, project) | ||
| if not os.path.exists(os.path.join(dwh_projects_root, project)): | ||
| subprocess.run(["git", "clone", github_url_template.format(aktin_project_name, project)], | ||
| cwd=dwh_projects_root) |
Member
There was a problem hiding this comment.
So it builds each project starting from starting_project. Move code into methods to make the script more readable like:
def clone_github_project_if_missing(repo_name: str, dest_path: Path):
if not (dest_path / "pom.xml").exists():
subprocess.check_call(["git", "clone", github_url_template.format(aktin_project_name, repo_name), str(dest_path)])
def build_project(project_path: Path):
completed_process: CompletedProcess = subprocess.run(["mvn", "clean", "install"], cwd=project_path)
if completed_process.returncode != 0:
raise SystemExit(f"Build failed for project: {project_path.name}")
And so on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.