Skip to content

Commit

Permalink
feat(ZMS-2184): All scss and js builds in the pipeline and local env (#…
Browse files Browse the repository at this point in the history
…673)

* feat(ZMS-2184): Add all SCSS and JS builds in the pipeline and local

* feat(ZMS-2184): Delete css and js builds.

* feat(ZMS-2184): remove lock files

* feat(ZMS-2184): remove lock files

* feat(ZMS-2184): fix unit test

* feat(ZMS-2184): remove compiled react js

* feat(ZMS-2184): remove node engine from package.json

* feat(ZMS-2184): remove composer.lock files from gitignore

* feat(ZMS-2184): remove package.lock files from gitignore

---------

Co-authored-by: Thomas Fink <thomasafink@Thomass-MacBook-Air.local>
  • Loading branch information
ThomasAFink and Thomas Fink authored Nov 6, 2024
1 parent d60a68f commit 390f49a
Show file tree
Hide file tree
Showing 44 changed files with 21,648 additions and 5,029 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ BerlinOnline Stadtportal GmbH & Co KG und it@M.
## Getting Started
- `ddev start`
- `ddev exec ./cli modules loop composer install`
- `ddev exec ./cli modules loop npm install`
- `ddev exec ./cli modules loop npm build`

## Import Database
- `ddev import-db --file=.resources/zms.sql`
Expand Down
52 changes: 47 additions & 5 deletions cli
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,20 @@ def cli_modules_reference_libraries(no_symlink: bool):
@cli_modules.command("loop")
@click.argument("commands", required=True, nargs=-1)
def cli_modules_loop(commands):
"""loops though all repositories and executes a given command"""
for module in modules:
print_info(f"Repository: {module}")
os.chdir(os.path.join(repo_dir, module))
os.system(" ".join(commands))
"""Loops through repositories and executes a given command. Limits npm commands to specific modules."""
specific_modules = ["zmsadmin", "zmscalldisplay", "zmsstatistic", "zmsticketprinter"]

is_npm_command = commands[0] == "npm"

target_modules = specific_modules if is_npm_command else modules

for module in target_modules:
print_info(f"Repository: {module}")
module_dir = os.path.join(repo_dir, module)
os.chdir(module_dir)

# Execute the command
os.system(" ".join(commands))


@cli_modules.command("check-upgrade")
Expand Down Expand Up @@ -142,6 +151,39 @@ def cli_clean_cache():
for module in modules:
os.system(f"rm -rf {module}/cache/*")
print_info("Cache cleaned")


@cli_modules.command("loop")
@click.argument("commands", required=True, nargs=-1)
def cli_modules_loop(commands):
"""Loops through repositories and executes a given command. Adds --legacy-peer-deps for npm install commands."""
specific_modules = ["zmsadmin", "zmscalldisplay", "zmsstatistic", "zmsticketprinter"]

is_npm_command = commands[0] == "npm"

build_commands = {
"zmsadmin": ["npm run build"],
"zmscalldisplay": ["npm run build"],
"zmsstatistic": ["npm run build"],
"zmsticketprinter": ["npm run build"]
}

target_modules = specific_modules if is_npm_command else modules

for module in target_modules:
print_info(f"Repository: {module}")
module_dir = os.path.join(repo_dir, module)
os.chdir(module_dir)

if is_npm_command and commands[1] == "install":
modified_commands = list(commands) + ["--legacy-peer-deps"]
os.system(" ".join(modified_commands))
elif is_npm_command and len(commands) > 1 and commands[1] == "build":
print_info(f"Running custom npm build commands for {module}")
for build_command in build_commands.get(module, []):
os.system(build_command)
else:
os.system(" ".join(commands))


if __name__ == "__main__":
Expand Down
3 changes: 1 addition & 2 deletions mellon/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
config.php
**.swp
tags

.DS_*
/vendor/
composer.lock
coverage
Loading

0 comments on commit 390f49a

Please sign in to comment.