I've been trying for the last few hours to do a nice convention-over-configuration implementation of the following scenario:
- When running
kamal deploy in GitHub Actions, the secrets are pulled from the environment (as they are stored in GitHub Secrets)
- When running it on my local machine, they're pulled from LastPass using
kamal secrets.
I understand I could do this in a number of ways:
- Writing a script that returns the same format as
kamal secrets fetch and then calling that from within .kamal/secrets
- Using
.env instead of LastPass and running dotenv kamal deploy when running locally
- Some sort of monstrosity within
.kamal/secrets that checks for the existence of the lpass command on every line
None of these feel very clean or convention-over-configuration to me. Does anyone have an alternative implementation?
Some wishlist changes to Kamal's behaviour that would be nice, if no standard nice way is availalbe:
- If Kamal just used the environment for all secrets if
.kamal/secrets is absent - that way I can have my CI merely delete the .kamal/secrets file before running kamal deploy and everything would work.
- A way to select a different
secrets file based on the presence of the CI environment variable, for example.
- Erb in the
secrets file? Still quite ugly.
I've been trying for the last few hours to do a nice convention-over-configuration implementation of the following scenario:
kamal deployin GitHub Actions, the secrets are pulled from the environment (as they are stored in GitHub Secrets)kamal secrets.I understand I could do this in a number of ways:
kamal secrets fetchand then calling that from within.kamal/secrets.envinstead of LastPass and runningdotenv kamal deploywhen running locally.kamal/secretsthat checks for the existence of thelpasscommand on every lineNone of these feel very clean or convention-over-configuration to me. Does anyone have an alternative implementation?
Some wishlist changes to Kamal's behaviour that would be nice, if no standard nice way is availalbe:
.kamal/secretsis absent - that way I can have my CI merely delete the.kamal/secretsfile before runningkamal deployand everything would work.secretsfile based on the presence of theCIenvironment variable, for example.secretsfile? Still quite ugly.