Managing Vault values in a pipeline

Hi. We're using the Vault integration rather extensively. We also deploy via a repository pipeline (Bitbucket). The values of the Vault entries change depending on the environment. In order for the pipeline to be fully functional, we need to be able to set those values from the pipeline itself. Bitbucket, like most repository hosting providers, offer secret management via their UI. The question is, how do we get those values into our Supabase hosted installations? In config.toml under the db.vault section, we've added lines like:
[db.vault]
project_url = "env(PROJECT_URL)"
[db.vault]
project_url = "env(PROJECT_URL)"
And this works perfectly in local (assuming you have PROJECT_URL defined in your supabase/.env file) but when we run our pipeline, which includes npx supabase install and has the PROJECT_URL variable defined in the environment, the value is not actually pushed to our supabase project. These are the lines we're using in the pipeline:
npm install supabase
npx supabase login --token "$SUPABASE_ACCESS_TOKEN"
npx supabase link --project-ref "$SUPABASE_PROJECT_REF"
npx supabase config push
npx supabase db push --include-all --password "$SUPABASE_DB_PASSWORD"
npx supabase functions deploy
npm install supabase
npx supabase login --token "$SUPABASE_ACCESS_TOKEN"
npx supabase link --project-ref "$SUPABASE_PROJECT_REF"
npx supabase config push
npx supabase db push --include-all --password "$SUPABASE_DB_PASSWORD"
npx supabase functions deploy
I realize I could run a SQL script that updates the values, but that somehow feels wrong. Any thoughts? TIA
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?