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

Pass in values from flags as template values to export --template mechanism #2246

Open
jrdn91 opened this issue Aug 6, 2024 · 8 comments
Open
Assignees
Labels
good first issue Good for newcomers

Comments

@jrdn91
Copy link

jrdn91 commented Aug 6, 2024

Feature description

Using the export --template feature, it would be great if I could pass in the values for projectId, environmentSlug, and folderPath as values from the flags called on the export command as opposed to only being able to specify those within the template file itself. Ideally I could specify in the file something like this...

{{$secrets := secret "$flags.projectId" "$flags.env" "$flags.path"}}
{{$length := len $secrets}}
{{- "{"}}
{{- with $secrets }}
{{- range $index, $secret := . }}
"{{ $secret.Key }}": "{{ $secret.Value }}"{{if lt $index (minus $length 1)}},{{end}}
{{- end }}
{{- end }}
{{ "}" -}}

And those would get pulled from the export call if I had something like infisical export --template="/some/template/file" --projectId=some-uuid --env=dev --path="/api"

Why would it be useful?

This would be specifically helpful for use with CI as often the values for those are pulled from something like Github secrets.

Additional context

Currently the way to do something like this using a template that you need the values to be pulled from CI would be to either write the file each time using CI steps, or have multiple files that you simple hard code the values into and have CI specify a different path for the template depending on the need.

@maidul98 maidul98 added the good first issue Good for newcomers label Aug 6, 2024
@thecodekaizen
Copy link

thecodekaizen commented Aug 6, 2024

Hello @maidul98 , can I take this up?

Or @jrdn91, are you already working on this?

@jrdn91
Copy link
Author

jrdn91 commented Aug 6, 2024

@vish198910 I am not working on this

@thecodekaizen
Copy link

@jrdn91 Understood.
So @maidul98, can I start working on this?

@akhilmhdh
Copy link
Member

@vish198910 Assigned to you then

@thecodekaizen
Copy link

Noted @akhilmhdh , I'm on it.

@saloni0419
Copy link

@vishnusharma10 are you still working on this issue

@thecodekaizen
Copy link

thecodekaizen commented Sep 2, 2024

yes I am working on it over the weekends @saloni0419 . I was not well for past 2 weeks so couldn't proceed much due to that reason.

@v-a14
Copy link

v-a14 commented Oct 23, 2024

Hello @vishnusharma10
Still working on this issue ?

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

No branches or pull requests

6 participants