chamber icon indicating copy to clipboard operation
chamber copied to clipboard

Feature Request: chamber load <service> <file>

Open Jinkxed opened this issue 9 years ago • 7 comments

Not sure if it's something you want to tackle or not, but would load the ability to specify an .env file or just a file with key value pairs.

We have a ton of rails apps that we are converting to use chamber and it would be really nice to just do something like:

chamber load someservice .env or something similar. Bonus points if it can exclude new lines and comments by default! More bonus points if I don't have to remove all the equal signs in the file!

I can definitely see this solution becoming a lot more popular with native AWS users, the simplicity is great.

Jinkxed avatar Aug 21 '17 15:08 Jinkxed

I'd love to jump on this. Still something anyone wants?

saopayne avatar Oct 14 '17 08:10 saopayne

This would be helpful but it would be even better to do it in reverse, export to .env. I think it's the same as issue #31

JGjorgji avatar Dec 25 '17 12:12 JGjorgji

Bonus points if it can exclude new lines and comments by default! More bonus points if I don't have to remove all the equal signs in the file!

Both of these can be solved by importing a yml file instead of an env file. Same for exporting. Whilst this would be a nice addition to chamber itself, it's also pretty easy to crank up in less than 40 lines, together with ordering, uppercasing and putting services into yml sections.

eskerda avatar Feb 09 '18 16:02 eskerda

I've just done this

awk '{ if( $1 != "" && substr($1, 0,1) != "#" ) print "chamber write service-name-here " $1 " " $2} ' FS="=" .env

I hope that helps; really hope they can convert it automatically soon!

ele0nard avatar Feb 09 '18 17:02 ele0nard

Wanted to give an update here, with the move to path based defaults in 2.0 (https://github.com/segmentio/chamber/pull/80), I've also added a chamber import function that may help with these kinds of uses. Right now, import only supports json import, but there is no reason we couldn't support more formats like chamber export does in the future.

dfuentes avatar Mar 16 '18 20:03 dfuentes

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 09 '19 05:03 stale[bot]

I'd argue this is done, with chamber import.

nickatsegment avatar Mar 12 '19 00:03 nickatsegment