RC Logr 20200627 103837
Saturday, 27 Jun, 2020
If you are using the aws cli tool, you can set the shell env var «AWS_PROFILE» to match your setup profile names linking to specific IAM credentials. 🍺 Here it is in a zsh function.
This function sets some local vars, sets AWS_PROFILE via
export then confirms it is set, then builds and deploys the site via
hugo deploy. The site has a config file with the “coolsitejp” target, and under that is specified which AWS S3 bucket to deploy to. Use
export instead of a simple assignation like I am doing with
_hugobin etc, because you want to have the variable ready for use when the script invokes
hugo to build and deploy the site. The last line unsets AWS_PROFILE for good measure if it was not set already, or resets it to whatever it was set to initially.