-
Notifications
You must be signed in to change notification settings - Fork 89
docs(cloud): Guide for private git dependencies #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
christerswahn
wants to merge
3
commits into
main
Choose a base branch
from
ces-dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+50
−8
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,9 @@ | ||||||||||
| # Handling private dependencies | ||||||||||
|
|
||||||||||
| Serverpod Cloud supports Dart workspaces for managing private dependencies in your deployments. This lets you include local packages and organize monorepo structures. | ||||||||||
| Serverpod Cloud supports deploying your project with private dependencies. | ||||||||||
| The typical methods are: | ||||||||||
| - Dart workspaces which lets you include local packages within a monorepo structure | ||||||||||
| - Access credentials for dependencies in private git repositories | ||||||||||
|
Comment on lines
+5
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: subject-verb mismatch on the first bullet. "workspaces" is plural, "lets" is singular. A comma before the relative clause also helps readability.
Suggested change
|
||||||||||
|
|
||||||||||
| ## Using Dart workspaces | ||||||||||
|
|
||||||||||
|
|
@@ -37,16 +40,55 @@ dependencies: | |||||||||
|
|
||||||||||
| When you deploy your Serverpod application, the CLI automatically detects workspace structures and includes all necessary workspace packages in your deployment package. | ||||||||||
|
|
||||||||||
| ## Current limitations | ||||||||||
| ## Using private git dependencies | ||||||||||
|
|
||||||||||
| Serverpod Cloud currently does not support: | ||||||||||
| If your server depends on Dart packages from a private git repository, the | ||||||||||
| Serverpod Cloud build process needs to be given read access to it. | ||||||||||
|
|
||||||||||
| - **Private git references**: Dependencies pointing to private Git repositories using `git:` URLs are not supported during deployment. | ||||||||||
| - **Private package managers**: Custom package registry configurations are not supported. | ||||||||||
| Do this by setting a _build secret_ on the project. SSH keys are supported, and you store the private SSH key in the build secret. | ||||||||||
|
|
||||||||||
| :::info | ||||||||||
| Build secrets are kept separate from runtime secrets and will not be accessible | ||||||||||
| anywhere outside the build pipeline. They are automatically encrypted in transit | ||||||||||
| and at rest. | ||||||||||
| ::: | ||||||||||
|
|
||||||||||
| ### CLI commands for build secrets | ||||||||||
|
|
||||||||||
| Use the `scloud deployment build-secret` commands to manage your build secrets. | ||||||||||
|
|
||||||||||
| #### List the current build secrets | ||||||||||
|
christerswahn marked this conversation as resolved.
|
||||||||||
| ```sh | ||||||||||
| $ scloud deployment build-secret list | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| #### Add or modify a build secret | ||||||||||
| ```sh | ||||||||||
| $ scloud deployment build-secret set MY_SECRET_NAME "my-private-ssh-key" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| If you need to include private code in your deployment, use Dart workspaces to manage these dependencies as local packages within your project structure. | ||||||||||
| #### Add or modify a build secret with the value in a file | ||||||||||
| ```sh | ||||||||||
| $ scloud deployment build-secret set MY_SECRET_NAME --from-file my_private_ssh_key_file | ||||||||||
| ``` | ||||||||||
|
christerswahn marked this conversation as resolved.
|
||||||||||
|
|
||||||||||
| #### Remove a build secret | ||||||||||
| ```sh | ||||||||||
| $ scloud deployment build-secret unset MY_SECRET_NAME | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### Accessing a private repository in GitHub | ||||||||||
|
|
||||||||||
| If you are using GitHub, you can set up a _deploy key_ for this. | ||||||||||
| It only needs read access. | ||||||||||
|
|
||||||||||
| ## Workspace detection | ||||||||||
| [Set up deploy keys in GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#set-up-deploy-keys) | ||||||||||
|
|
||||||||||
| The deployment process automatically detects if your project uses workspace resolution. When deploying from within a workspace, all workspace packages required by your Serverpod application are automatically included in the deployment package. | ||||||||||
| Then store the private SSH key as a build secret on your Serverpod Cloud project, | ||||||||||
| and redeploy. | ||||||||||
|
|
||||||||||
| ## Current limitations | ||||||||||
|
|
||||||||||
| Serverpod Cloud currently does not support: | ||||||||||
|
|
||||||||||
| - **Private package managers**: Custom package registry configurations are not supported. | ||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.