crunchy-containers icon indicating copy to clipboard operation
crunchy-containers copied to clipboard

envsubst instead of sed

Open frafra opened this issue 5 years ago • 3 comments

What is the motivation or use case for the change? Replacing variables using sed is pretty rough and prone to errors and misreplacements.

https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L162-L169

https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L295-L298

https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L343-L348

Describe the solution you'd like What about envsubst? It has been made for that purpose back in 2009.

It would be also nice to use it here: https://github.com/CrunchyData/crunchy-containers/blob/237245acd35a5fc15cec2f14c00a040bd3b5eed0/bin/postgres/start.sh#L353

frafra avatar Feb 25 '20 12:02 frafra

Open to the idea. Please feel free to submit a patch :smile:

jkatz avatar Feb 27 '20 22:02 jkatz

I have issues building images locally, so I am not able to test them at the moment:

error dry-running "ADD conf/RPM-GPG-KEY-crunchydata  /": no files found matching "/home/frafra/Code/crunchy-containers/conf/RPM-GPG-KEY-crunchydata": no such file or directory

frafra avatar Mar 01 '20 16:03 frafra

Hi @frafra,

Thanks for your patience. The files you need to build are now available. You can get the key/repo file here:

https://www.crunchydata.com/developers/download-postgres/binaries/postgresql12

Thanks!

jkatz avatar Apr 21 '20 01:04 jkatz