Nodejs Single file uploads instead of full deploy, no longer work

  1. Feature Branch: Create a separate Git branch for the ongoing development of the big feature. This allows you to isolate the work on this feature from other changes in your codebase.

  2. Fix Branch: When you need to address a small fix or bug, create another branch specifically for that fix.

  3. Work on the Fix: Make the necessary code changes in the “small-fix” branch to address the issue.

  4. Test the Fix: Test the small fix thoroughly in the “small-fix” branch to ensure it works as expected.

  5. Merge the Fix: Once the small fix is ready, merge the “small-fix” branch into the “master” branch if you want to release the fix independently of the big feature.

  6. Deploy your app.

And when I click Deploy button in Wappler it will copy/upload to the PROD only changed files? Or the whole project?

It will deploy your project as usual, but the only changed file(s) will be the one(s) you edited in your work on the small fix branch.

What you just described is completely different thing working with branches. And this doesn’t solve a problem that now we can’t deploy/copy/upload a single file (which was fast and time eficient) to the PROD and have changes on the fly.

And i think you maybe don’t really get the idea of how docker and containers work. Docker operates differently from FTP in terms of how it manages and deploys applications. Docker containers package an entire application into a single unit. This unit is a container image, and when you deploy a container, you deploy the entire image, not just individual files. It’s not the same as working with FTP where you push single files separately.

Even for small changes, it’s a better practice to build a new container image with the necessary updates and then redeploy that updated image. This aligns with the container philosophy of treating containers as disposable and reproducible units.

I’m not sure why are you changing topics and started the discussion about Docker but here is documentation that you might find interesting: https://docs.docker.com/compose/file-watch/

" You don’t need to switch on watch for all services in a Compose project. In some instances, only part of the project, for example the Javascript frontend, might be suitable for automatic updates."

Isn’t this topic about Docker and single file uploads, or did i understand it wrongly?

I’m sorry, but if you think it is normal to disable one of the features in your product without notifying your clients and trying to prove that there there is workaround (which IS NOT) - I’m not the one who will tell you - you are behaving wrong - you have to think out by yourself.

That is not what i am doing in the topic.
I’m just trying to help here and provided a solution to this specific question:

ok @Teodor, agree with you, but we plan releases based on what we have available in Wappler! We didn’t create a branch for the big feature because we had the possibility to upload single files and it disappeared suddenly! It is creating a big problem to our project! How can we sort this out?

nodemon is a tool that should normally only be used in development, on the server it can cause unexpected problems.

The reason why we removed it is that nodemon catches errors and then waits for a file change, this is fine in development where you see that there is an error and you fix that file and server restarts after you save the fixed file. On the server you don’t see that error and the server just stops working and waits for a file being updated. Docker has a build-in restart when the node process crashes, nodemon prevents this making your server unresponsive.

A full deploy is how you would normally update your server. You can change (upload) a file in the docker container, then you need to manually restart the container to make sure the server loads the changes.

2 Likes

Compose watch is also used for local development only but there we don’t n ed it as you have nodemon and also locally mapped files to the docker containers.

You can create a branch from a previous commit, haven’t explored how to do it in Wappler but any decent Git GUI can make it

Sounds like someone should do a video tutorial :video_camera:

P.S: If you didn’t create commits before, that’s more complicated :frowning:

Thanks @Apple, but we have too much commits due the new feature… plus, we have new migrations… this upload disappear was a bad move from the team, without any notice or consultation.

As said before you can perfectly upload a single file, but if your file is cached by the server like server Connect files or NodeJS pages, you just need to restart the service. This can be done from the bottom toolbar.

But of course the best way is to use deploy to make sure it all goes in a single step for best reliability.

ahhh got it! thanks george!

What about an ‘upload & restart’ option for Node projects? If people want to upload a file they can and it’s clear the container will restart.

2 Likes