From 8284799ddbe93450294509a53fd2acda8c58bb79 Mon Sep 17 00:00:00 2001 From: developerjamiu Date: Fri, 20 Nov 2026 15:47:10 +0100 Subject: [PATCH] docs: Correct where .scloudignore rules apply and what a deploy uploads --- cloud_docs/concepts/deployments.md | 14 +++++++++++--- cloud_docs/guides/ship-non-dart-files.md | 4 ++-- .../reference/cli/commands/project/_project.md | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cloud_docs/concepts/deployments.md b/cloud_docs/concepts/deployments.md index 10e0ccd6..513a6fdc 100644 --- a/cloud_docs/concepts/deployments.md +++ b/cloud_docs/concepts/deployments.md @@ -116,11 +116,19 @@ serverpod cloud deploy --output deployment.zip --wet-run ## Configure what's included -A `.scloudignore` file in your project root controls which files are packaged. The syntax mirrors `.gitignore`. +A deploy uploads your server project. In a Serverpod 4 project, which is a Dart workspace, it also uploads the workspace packages your server depends on and the workspace's root `pubspec.yaml` and `pubspec.lock`. Your Flutter app and other folders at the workspace root aren't uploaded. -By default, every file ignored by `.gitignore` is also excluded from the deployment. To include files that `.gitignore` excludes, prefix the pattern with `!` in your `.scloudignore`: +Within what's uploaded, a deploy leaves out: -```text title=".scloudignore" +- Files your `.gitignore` files exclude +- Hidden files and folders, whose names start with `.` +- Files your `.scloudignore` files exclude + +The CLI creates a `.scloudignore` in your server project, such as `my_project_server/`, when you link or deploy the project. In a workspace, it also creates one in the workspace root. Its template already leaves out your passwords and config files. It also keeps your generated code and the files under `web/`, such as your Flutter web build, even where `.gitignore` excludes them. + +The syntax mirrors `.gitignore`. A pattern with a `/` at the start or in the middle is relative to the folder of the `.scloudignore` it's in. Other patterns match at any depth. To upload a file that a `.gitignore` excludes, add the pattern with a `!` prefix to a `.scloudignore` in the same folder as that `.gitignore`, or in a folder below it. For files in your server project, that's usually the server project's `.scloudignore`: + +```text title="my_project_server/.scloudignore" # Exclude a specific file /specific_file.txt diff --git a/cloud_docs/guides/ship-non-dart-files.md b/cloud_docs/guides/ship-non-dart-files.md index faf2c6cb..3ba3349a 100644 --- a/cloud_docs/guides/ship-non-dart-files.md +++ b/cloud_docs/guides/ship-non-dart-files.md @@ -6,7 +6,7 @@ description: Include configuration files, templates, data, or other non-Dart ass # Ship non-Dart files with your server -Bundle non-Dart files (configuration, templates, CSV data, binary blobs) with your server code on Cloud. Place them in an `assets/` folder at the project root and read them with `./assets/` at runtime. +Bundle non-Dart files (configuration, templates, CSV data, binary blobs) with your server code on Cloud. Place them in an `assets/` folder in your server project and read them with `./assets/` at runtime. ## Before you start @@ -37,7 +37,7 @@ Then deploy: serverpod cloud deploy ``` -Cloud zips your project directory and includes every file that isn't excluded from the deploy package (see [Control what gets uploaded](#control-what-gets-uploaded) below). The `assets/` name is the Serverpod naming convention for this folder. You can call it anything, but the rest of this guide assumes `assets/`. +Cloud zips your server project and includes every file that isn't excluded from the deploy package (see [Control what gets uploaded](#control-what-gets-uploaded) below). The `assets/` name is the Serverpod naming convention for this folder. You can call it anything, but the rest of this guide assumes `assets/`. To preview which files Cloud will upload before deploying: diff --git a/cloud_docs/reference/cli/commands/project/_project.md b/cloud_docs/reference/cli/commands/project/_project.md index d3668f1e..c4c695ed 100644 --- a/cloud_docs/reference/cli/commands/project/_project.md +++ b/cloud_docs/reference/cli/commands/project/_project.md @@ -17,5 +17,5 @@ If the project doesn't need a database, pass `--no-enable-db` instead. Once crea The link command writes or updates three files in your local project directory: 1. **`scloud.yaml`**: contains the project ID that ties your codebase to the Cloud project. Created in your server package directory (or the one specified with `--project-dir`). -2. **`.scloudignore`**: created from a template if it doesn't exist; defines which files should be excluded when uploading to Cloud (syntax mirrors `.gitignore`). +2. **`.scloudignore`**: created from a template if it doesn't exist, in your server package directory and, for a workspace, in the workspace root. It defines which files are excluded when uploading to Cloud (syntax mirrors `.gitignore`). 3. **`.gitignore`**: if your project is a workspace, the `.scloud/` directory is added to keep deployment artifacts out of version control.