blob: eeb0eaa7c5f2df4c2d7f366ac236851fb4a370a6 [file] [log] [blame]
# Create the secrets needed for leasing server to send email.
set -e
if [ "$#" -ne 1 ]; then
echo "The argument must be the email address we are authenticating, for example:"
echo ""
echo "./"
exit 1
# Convert to leasing-skia-org.
source ../bash/
# Enable the gmail API for your project and create a client secret for this applicaiton.
# Then download the client_secret.json file.
echo "Download client_secret.json for leasing server to /tmp/ramdisk."
read -r -p "Press enter to continue..." key
# Then run 'three_legged_flow' in this directory and when prompted authorize
# as the email passed in to create the client_token.json file.
go install ./go/three_legged_flow
cd /tmp/ramdisk
three_legged_flow --scopes=
kubectl create secret generic leasing-email-secrets \
--from-file=./client_secret.json \
--from-file=./client_token.json \
--dry-run -o yaml | kubectl apply -f -
# Finally, remove the token file since it contains a refresh token.
rm client_token.json
cd -