I have a list of application configs and business configs in a particular root folder inside our git repository.
Below is our current structure as of now:
- We have a root
Datafolder and inside that we have multiple sub-folders which has bunch of application and business conigs. - Each sub-folder has different number of application or business configs compared to other sub-folders.
- Total sub-folders can be more than 10 and total number of files inside each sub-folders are random and they can be 100 max.
- Each files are very small like few KB's. Each Sub-folder and file names are different than what I have shown below.
I came up with below names just to make my question clear to understand -
Data
folder1
files1.json
files2.json
files3.json
files4.json
folder2
files5.json
files6.json
files7.json
folder3
files8.json
files9.json
files10.json
files11.json
folder4
files12.json
files13.json
files14.json
files15.json
folder5
files16.json
files17.json
files18.json
files19.json
folder6
files20.json
files21.json
files22.json
files23.json
Now with each commit we make a zip folder of all the files and subfolders exactly in the same structure as shown above so once you unzip it on the disk, it will show root folder Data, each sub-folders inside root folder and all files inside each sub-folder exactly as show above.
For example: Modifying any file above or adding a new file in any subfolder or adding a new folder, we make a zip folder of all the files and subfolders exactly in the same structure as shown above.
Problem Statement:
Now we have a new requrirement where we need files for each environment (dev/stage/prod). Below is my requirement:
- I can have some files for each environment with different content. For eg: file1 can be in dev, stage and prod with different contents.
- But there can be some files which are same for all 3 environment so don't need to duplicate those files for each environment.
How can I represent my folder structure and files in my git repo so that it is easier for me to understand by looking at the structure and also achieve above those two new requirements in a clean way?
Below is one design I was able to come up with but it violates my second requirement as I mentioned above since I am duplicating each file in different environments even they are same.
Data
dev
folder1
files1.json
files2.json
files3.json
files4.json
folder2
files5.json
files6.json
files7.json
folder3
files8.json
files9.json
files10.json
files11.json
folder4
files12.json
files13.json
files14.json
files15.json
folder5
files16.json
files17.json
files18.json
files19.json
folder6
files20.json
files21.json
files22.json
files23.json
stage
folder1
files1.json
files2.json
files3.json
files4.json
folder2
files5.json
files6.json
files7.json
folder3
files8.json
files9.json
files10.json
files11.json
folder4
files12.json
files13.json
files14.json
files15.json
folder5
files16.json
files17.json
files18.json
files19.json
folder6
files20.json
files21.json
files22.json
files23.json
prod
folder1
files1.json
files2.json
files3.json
files4.json
folder2
files5.json
files6.json
files7.json
folder3
files8.json
files9.json
files10.json
files11.json
folder4
files12.json
files13.json
files14.json
files15.json
folder5
files16.json
files17.json
files18.json
files19.json
folder6
files20.json
files21.json
files22.json
files23.json