supabase / cli

Supabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
https://supabase.com/docs/reference/cli/about
MIT License
1.02k stars 201 forks source link

supabase functions deploy failed via gitlab ci #2597

Closed tckm closed 1 month ago

tckm commented 1 month ago

Describe the bug supabase functions deployfailed via gitlab ci

To Reproduce

Expected behavior

use GitLab CI to automate Edge Function deployments.

System information

sweatybridge commented 1 month ago

I just checked that deploying functions from gitlab pipeline is working as expected https://gitlab.com/sweatybridge/setup-cli/-/blob/main/.gitlab-ci.yml?ref_type=heads

I'm guessing it's because you commented out the DOCKER_HOST variable, so try these config below

deploy-function:
  stage: deploy
  script:
    - npx supabase functions deploy
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    SUPABASE_PROJECT_ID: $TEST_SUPABASE_PROJECT_ID
    SUPABASE_ACCESS_TOKEN: $TEST_SUPABASE_ACCESS_TOKEN
  tags: # add
    - build
    - docker
tckm commented 1 month ago

Finally, it was discovered that the issue was with the GitLab Docker Runner configuration.

The problem was resolved by adding the /builds:/builds parameter to the volumes configuration.