Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: To add env variables caching mechanism. #28

Open
Creatoon opened this issue Feb 12, 2022 · 3 comments
Open

feat: To add env variables caching mechanism. #28

Creatoon opened this issue Feb 12, 2022 · 3 comments

Comments

@Creatoon
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, we deploy applications with environment variables but our "Deploy CLI" doesn't have an env variable caching mechanism.

Describe the solution you'd like
What I think is, we should store a particular application config at the below path:

$  .metacall/deploy/applications/projectName.ini

For Ex:

$  .metacall/deploy/applications/auth-middleware.ini

Now, Why I think it should look like that is because:-

  1. We can store all application data in a single folder and it's nicely separated
  2. Name of the file is like -> projectName.ini -> All the config of those applications having the same name and located in different paths can be accumulated here, one-stop solution

Let's see config file structure

[path.home_raj_desktop_authMiddleware.plan.essential.env]
ENVIROMENT=dev
PORT=5000
HOST=localhost
USER=Creatoon
MAILCHIMP_API_KEY=fssdgdfgfg565756867993ddcbbcbc

[path.home_raj_desktop_authMiddleware.plan.standard.env]
ENVIROMENT=prod
PORT=9000
HOST=https://creatoon.tech
USER=SuperUser
MAILCHIMP_API_KEY=fssdgdfgfg565756867993ddcbbcbc

[path.home_raj_desktop_authMiddleware.plan.premium.env]
ENVIROMENT=prod
PORT=8000
HOST=https://creatoon.tech
USER=SuperUser
MAILCHIMP_API_KEY=fssdgdfgfg565756867993ddcbbcbc

Why this kind of config structure?
It's simply because there may be a case when a user deploys a minimal version of an application on "Essential" Plan with some environment variables & production-grade version on "Standard and Premium" Plans with different values of env variables, that's why I figured out this structure for caching.

So after parsing it would look something like this:

{
  path: {
    home_raj_desktop_authMiddleware : {
      plan : {
        essential : {
          env: {
            ENVIROMENT: "dev",
            PORT: 5000,
            HOST: "localhost",
            USER: "Creatoon",
            MAILCHIMP_API_KEY: "fssdgdfgfg565756867993ddcbbcbc"
          }
        },
        standard : {
          env: {
            ENVIROMENT: "prod",
            PORT: 9000,
            HOST: "https://creatoon.tech",
            USER: "SuperUser",
            MAILCHIMP_API_KEY: "fssdgdfgfg565756867993ddcbbcbc"
          }
        },
        premium : {
          env: {
            ENVIROMENT: "prod",
            PORT: 8000,
            HOST: "https://creatoon.tech",
            USER: "SuperUser",
            MAILCHIMP_API_KEY: "fssdgdfgfg565756867993ddcbbcbc"
          }
        }
      }
    }
  }
  
  
}

Additional Context
We should also think about, what if the user re-deploys with some additional environment variables then we should give him an option to add more and update ones that are already cached.

@trgwii @viferga What do you think sir?
If you think it is incorrect or whatever you think about it, let me discuss it.

Thanks

@viferga
Copy link
Member

viferga commented Feb 25, 2022

I think the best option may be caching them in the backend. But this idea can be reused for caching other things like preferences (no secrets). So until we implement this, I am going to leave this issue open.

@ashutosh887
Copy link

I would like to work on this Issue if not resolved @Creatoon @viferga

@Creatoon
Copy link
Contributor Author

@ashutosh887 At current stage we are not caching prefs on deploy cli side, instead we are caching it on the backend (faas side)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants