dmitry-buykin commented on issue #2418:
URL: 
https://github.com/apache/incubator-kie-tools/issues/2418#issuecomment-2162305678

   @tiagobento In my case I work with a local folder of `dmn` files for 
development - it's not a whole repository, but a sub-folder in the sandbox for 
multiple projects. As I could see in `online-editor/importFromUrl`, it's 
possible to retrieve data from github or another git repo link, but not from an 
arbitrary folder of the web server. 
   
   I've prepared script which is starting docker-compose with mapping project 
to 
   ```docker
     kie_sandbox:
       container_name: kie_sandbox
       volumes:
         - ${PROJECT_HOME}:/var/www/html/samples
   ``` 
   and then starting this project and opening link in the browser:
   ```bash
   start_project() {
     local project_home=${1:-$(pwd)}
     local dmn=$2
     local kie_port
     kie_port=$(get_kie_sandbox_port "$ENV_PATH")
     if [[ -z $kie_port ]]; then
       echo "Error: Could not find 
KIE_SANDBOX_DISTRIBUTION__kieSandboxExposedPort in $ENV_PATH"
       exit 1
     fi
     # Start Docker Compose with the project home mapped to the container
     PROJECT_HOME="$project_home" docker-compose -f "$DOCKER_COMPOSE_PATH" 
--env-file "$ENV_PATH" up -d
     # Wait for the container to start
     wait_for_container kie_sandbox
     # Wait for the port to be exposed
     wait_for_port "$kie_port"
     # Generate the HTTP link
     local 
link="http://localhost:$kie_port/#/import?url=http://localhost:$kie_port/samples/$dmn";
     echo "Opening $link in the default browser..."
     sleep 2
     # Open the link in the default browser
     if command -v xdg-open > /dev/null; then
       xdg-open "$link"
     elif command -v open > /dev/null; then
       open "$link"
     else
       echo "Please open $link in your browser."
     fi
   }
   ```
   
   It is really useful when you work with many small projects, so you can 
switch between projects. My focus here is not on opening samples in browser, 
but rather how to optimize my daily work by improving environment for many 
small projects - with ability to switch between many small projects, usually 
3-10 dmn files (up to 150 in extreme cases, but for it I would rather use 
VSCode extension).
   
   So I'm asking about a practical tool for local development when switching 
between contexts. I don't want to use a dedicated github repo with proxy, 
because 1) I have multiple small projects in the single monorepo. 2) I need a 
tool for local debugging and testing - it's usually 1-2 weeks of development 
and debugging without publishing.
   
   I think the main issue with Kie toolbox - it's not designed for TDD and 
code-first development, but rather for UI editing. For complex logic with many 
variations, I need to maintain a large set of test cases which I want to run 
regular, plus ability to quickly spin-up project, check how it works with some 
corner cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to