Merge two different Verdaccio storage folders (CouchDb databases) - couchdb

I am trying to set up a completely offline Verdaccio installation that I can use as a proxy for NPM packages for a small team of developers and for our build machine.
My challenge is that I would like to be able to update the offline npm packages from time to time (to add more packages). To do this, the only possibility I have is to use another machine (a laptop) that is outside this isolated network and has a separate Verdaccio installation and npm install the packages there. After installation I have the new tgz files in the storage folder. But my question is how do I merge the Storage folder from the offline Verdaccio installation with the Storage folder of the online one. Because I cannot do this manually, especially when you have packages with a lot of dependencies.
Is there some replication that I could easily setup (I am not an expert in CouchDb) or even a plain CLI instruction I could use? Or is there a way to achieve this with Verdaccio or some other utility?
Please bear in mind that this network is completely isolated (without network access) even if it is also used for development.

I just got the craziest idea that could be a good solution:
Whenever I will need to merge a new storage folder content, I will just copy it to a temporary location, start a new Verdaccio instance (with the storage at that location), then simply set the uplink of the main instance to the new/temporary one.
This way I will be able to run 'npm install' on the new packages on the main registry and this will automatically update the main storage folder (merge the databases). At the end I simply stop the second Verdaccio instance and cleanup the temp folder.

For this problem exactly I created this CLI tool: bulk-npm-publish.
How to use it:
Copy the storage folder to your isolated network.
Run bulk-npm-publish
3: Follow the steps (if you pass -i It will run interactively.
Run the outputted publish script.
with this tool you can skip already existing packages.

Related

New developer process for Hybris

I am working on learning Hybris. I have successfully install hybris, there are lots and lots of blogs out there that talk about getting the core hybris install with your own custom moduleds to make changes to, such as this one:
http://javainsimpleway.com/hybris-b2b-installation/
In the blog above the gentleman creates a mystore. The question I have is this: Once you have this all setup, you have made changes to the mystore modules and you want get those changes onto a new developers machine (or productions machine), who do you do it?
What I have tried, which does not work is this:
zipped up the bin/custom/mystore, config/local.properties, and localextensions.xml
followed his steps 1 thru 4
unzipped the files on the new machine
jumped down to step 12 where he does an ant clean all initialize
One difference between his process and mine is that I am adding some addon's. It is my impression that all those changes happen with custom/mystore, but to be safe between my steps 3 & 4 I have rerun the ant addoninstall for all four addon's.
The process I have documented, SmartEdit was not working and I found SAP's documentation about running ant npminstall because Hybris does not include npm-related 3rd party JavaScript libraries. This are blowing up when I go to run ant npminstall.
I really feel like I am trying to recreate the wheel here. I would imagine what I am trying to do is very common to any Hybris team, but I cannot find documentation on how to do it. Does anyone know of a blog out there that talks about how to migrate the source from one machine to another?
there are lots and lots of blogs out there that talk about getting the
core hybris install with your own custom moduleds to make changes to
Although they may be helpful, I would suggest you stick to official Hybris documentation (e.g. https://help.sap.com/viewer/4c33bf189ab9409e84e589295c36d96e/1905/en-US/8acc8a5a86691014a20781b3f738213e.html) which is quite rich.
Once you have this all setup, you have made changes to the mystore
modules and you want get those changes onto a new developers machine
(or productions machine), who do you do it?
For production deployment, please go through https://wiki.hybris.com/display/hybrisALF/Ant+Production+for+Continuous+Integration
However, for simply copying the things from one machine to another machine, whatever artefacts you have already copied to the target machine (after you have installed Hybris on the target machine), are correct. If you are working in a team, you typically set up an SCM (e.g. git, SVN etc.) code repository and then it becomes easier.
It is my impression that all those changes happen with custom/mystore
This is a wrong impression. When you run addon install it creates/updates the project.properties file in the addon; not in your custom/mystore. So, if the addon is part of the code repository (which is typically not the case unless it is a custom addon), anyone pulling your code on their machine will automatically get the addon project.properties and therefore they will not require to run addon install on their machines; otherwise, they need to run addon install on their machines. A workaround is to copy the content of the addon project.properties to the local.properties (and thus getting the changes to the target machine when the local.properties is copied to the target machine).
This are blowing up when I go to run ant npminstall.
Make sure to run ant npminstall as an admin user. Please check https://answers.sap.com/questions/12771768/smart-edit-unable-to-find-local-grunt.html for another option.

ProGet not importing npm packages from Drop Path

I am in the process of migrating to the latest version of ProGet. I'm currently using version 3.8.6, so am quite far behind the stable release.
I decided to start fresh, moving to a brand new Windows Server 2016 box in AWS, and using RDS for the SQL database.
The new setup is working perfectly, I have imported our NuGet packages by creating a feed, entering a Drop Path and dropping all of the packages there. ProGet picked up on this and moved them all to the Feed.
However, I am now trying to import our npm packages. I've created the feed, added a drop location and moved all the npm packges over. On the old server, they're all already in subfolders. ProGet seems to refuse to add them unless they're in the root folder specified as the Drop Path. So I've moved some packages there (inconveniently they're all called package.tgz...) and it picks them up, moves them to /ProgramData/ProGet/Packages/.npm/F5/ puts them in folder too but then does not become visble in the feed on the web interface.
The package number increases, and if I click packages I can see them all, then click into them and download the package, but it doesn't show up on the main Feed 'Page'.
On the other hand, if I manually upload a package via the web interface, it doesn't put the packages in the same location as above, but it is visible on the main feed page... Is this a bug or am I doing something wrong? The NuGet packages work perfectly using the same method, so I'm confused as to why npm isn't working.
I noticed this same behavior when using the bulk upload utilizing the drop path. From what I can tell, you must have at least one version with the "latest" tag on the details for it to show anything in the Feeds view.

Continous development with Docker containers

I'm using docker for a new project for learning purposes. I thought that it would make things a lot easier since I have to setup the environment only once.
I've created a setup like this; I created a base image that installs Ubuntu and NodeJS. I've also created a Development image that copies a src (web application) folder into the container, then does an npm install and runs the server.js. That's basically it in a nutshell.
But now, whenever I make a change to my source code I have to stop the running container, and build the image and run it again. It doesn't take long to rebuild and run de Development image, but it gets a bit annoying to do that eveythime I make a change to my code during development.
What I normally had was a Gulp task or Browsersync watching my local files. Everytime I made a change, those changes were automatically visible in the browser. That really speeds up the development process.
I could still work like this during development by installing everything locally. But that kinda defeats the purpose of having a "development image". That means that I still have to configure all the systems that want to work on this web application with the appropiate Node version, Database schemes, port mappings, SSL settings, Certificats etc.
So my questions is, is there a way to run a container, and whenever I change the source code (locally), that it is then automatically pushed to the running container? So I have "continuous development"?
If I understood you correctly, you don't wish to build the Development image each time you update the src. If that's the situation, what you can do is:
For the Development Phase (When the Source code is update frequently):
Create a Dockerfile in such a way that make use of a shared volume (where the source code will reside).
In the shared volume, you can update the source code using the src container.
Also, if you need to do some additional task, you can write it in a script and call that script each time you update the source.
Later on, when the development phase ends, you may use your current Dockerfile to build the development image.

Deploy NWJS with docker

I am developing an app with NWJS, now I am thinking in the deploy process, what I need is install the app into different machines that will use that app, the problem that I see is if I change some file I will need install again into each machine, I was reading about docker and if I understood fine, I can make an Image and download the last version of the app into each machine that use the app.
The Question is if can I upload the app into a container and download that into each machine?, and How can I search the documentation for do that?.
Thanks for any help
I think I've cheated my way into a solution, this could work for you, depending on what your exact requirements are.
In one scenario, I have a shared network folder that allows machines to launch the NWJS app via the network share, so every time I update the file and someone relaunches their short-cut, they have a fresh copy.
The remote users, who are not directly on our same network, has their copy in a DropBox folder - which - of course - automatically update as I drop the new copy into that folder.
None of these solutions are as "clean" as an installer, but, for our use case, works rather well. It's a bonus that DropBox handles the downloading of the new copy of the file automatically.

How to package synced folder in vagrant box

What I want and achieved so far:
I want to create a custom vagrant box including a configuration and an application to reuse it in different client or serve environments.
Specifically I managed to create vagrant box, based on Ubuntu (precise/64), that has node.js installed, and package it on my dev machine with
vagrant package my-box --output filename.box
I am able to copy the filename.box to a remote server and vagrant up the box there. Node.js is installed within the vagrant box as expected.
The problem is, that I am not able to package the files in the synced folder vagrant. After starting the box on the remote server, the synced folder is empty
Therefore the application I developed on the local machine is not included in the box.
I tried to find a solution or any information about this behavior, but apart from this unanswered Post i couldn't find anything on the net.
My questions:
How can i preserve the files in the synced folder and package them in the filename.box for reuse in the server environment.
Is this even possible? Is the behavior I see a bug or is Vagrant not meant to package the files also?
I didn't do any configuration for the synced folders so far. Is it possible to package files from a different synced folder than the regular /vagrant?
If this is not possible at all, what are best practices for deployment or reusage of vagrant environments including applications?
1-3) No. This is not possible and not intended to work in the way you expect it to work.
Think of VirtualBox's shared folder as a mounted volume on a remote machine. It's not part of the file system of your virtual machine. The actual data is saved on the host machine, not the virtual one.
4) If you want to add data into your box, just copy your data over to the vm before you pack it. No need to use shared folders.
You cannot package a synced folder but what you are desiring is absolutely possible.
The easiest way to accomplish this is to put the data in some other directory in the box (thus ensuring it gets packaged with the box). And during the Vagrant box's provisioning, move or copy the data to the synced directory.
Once the box is up and running, the synced directory will have the files you want in it.

Resources