• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 19699968033

26 Nov 2025 10:07AM UTC coverage: 54.995% (-0.4%) from 55.403%
19699968033

Pull #4368

github

web-flow
Merge b6a3e01eb into 6558d59e6
Pull Request #4368: feat: add deploy command to push all changes to linked project

45 of 181 new or added lines in 10 files covered. (24.86%)

15 existing lines in 2 files now uncovered.

6705 of 12192 relevant lines covered (55.0%)

6.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/deploy.go
1
package cmd
2

3
import (
4
        "os"
5
        "os/signal"
6

7
        "github.com/spf13/afero"
8
        "github.com/spf13/cobra"
9
        "github.com/spf13/viper"
10
        "github.com/supabase/cli/internal/deploy"
11
        "github.com/supabase/cli/internal/utils/flags"
12
)
13

14
var (
15
        deployCmd = &cobra.Command{
16
                GroupID: groupQuickStart,
17
                Use:     "deploy",
18
                Short:   "Push all local changes to a Supabase project",
19
                Long: `Deploy local changes to a remote Supabase project.
20

21
By default, this command will:
22
  - Push database migrations (supabase db push)
23
  - Deploy edge functions (supabase functions deploy)
24

25
You can optionally include config changes with --include-config.
26
Use individual flags to customize what gets deployed.`,
NEW
27
                RunE: func(cmd *cobra.Command, args []string) error {
×
NEW
28
                        ctx, _ := signal.NotifyContext(cmd.Context(), os.Interrupt)
×
NEW
29
                        fsys := afero.NewOsFs()
×
NEW
30
                        return deploy.Run(ctx, dryRun, fsys)
×
NEW
31
                },
×
32
                Example: `  supabase deploy
33
  supabase deploy --include-config
34
  supabase deploy --include-db --include-functions
35
  supabase deploy --dry-run`,
36
        }
37
)
38

NEW
39
func init() {
×
NEW
40
        cmdFlags := deployCmd.Flags()
×
NEW
41
        cmdFlags.BoolVar(&dryRun, "dry-run", false, "Print operations that would be performed without executing them")
×
NEW
42
        cmdFlags.String("db-url", "", "Deploys to the database specified by the connection string (must be percent-encoded)")
×
NEW
43
        cmdFlags.Bool("linked", true, "Deploys to the linked project")
×
NEW
44
        cmdFlags.Bool("local", false, "Deploys to the local database")
×
NEW
45
        deployCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
×
NEW
46
        cmdFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database")
×
NEW
47
        cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", cmdFlags.Lookup("password")))
×
NEW
48
        cmdFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project")
×
NEW
49
        rootCmd.AddCommand(deployCmd)
×
NEW
50
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc