cloud_register()
Register a Local Project on Framework Cloud and Link It
Creates the Cloud project for a folder that is already a Framework project (one you adopted with adopt() or brought up to date with upgrade()) and links the folder to it, in one step:
Usage
cloud_register(
path = ".",
name = NULL,
slug = NULL,
description = NULL,
dry_run = FALSE,
include_private = FALSE
)
Arguments
| Name | Default | Description |
|---|---|---|
| path | "." |
The project folder (default: the working directory). |
| name | NULL |
The Cloud project's name. Default: the spec's name, then the folder's name. |
| slug | NULL |
The project's slug. Default: made from the name (lowercase letters, digits, and hyphens). |
| description | NULL |
An optional description. |
| dry_run | FALSE |
If TRUE, print the request without sending it. |
| include_private | FALSE |
A project whose path has a folder named |
Value
Invisibly, a list with slug, url, type, adopted, created, linked, and spec_changed; with dry_run = TRUE, the request body.
Details
- Sends
.framework/spec.jsonas it is, with the name, slug, and description, in one request (POST /api/v1/projects). Framework Cloud stores the spec as the project's only layer and as its last-received spec, so the Cloud project has exactly this folder's name, type, language, folders, and tools, and none of your defaults. An adopted project is marked as adopted. - Writes the project token and server to
.env(FW_PROJECT_TOKEN,FW_CLOUD_URL), making sure git ignores.envfirst. An empty or differentFW_CLOUD_URLis replaced.
It needs .framework/spec.json (run upgrade(dry_run = FALSE) first for an older project), changes nothing in a project that already has a token in .env, and refuses when git tracks .env. When you already have a project with the slug, it offers to link this folder to that project instead (in an interactive session) and creates nothing. A slug held by a project in your Trash can't be reused. A self-hosted server from before the spec API builds the project from your defaults; the spec is then sent separately (PUT /api/v1/project/spec).
Examples
Not run
if (FALSE) {
cloud_register("~/projects/old-study", dry_run = TRUE)
cloud_register("~/projects/old-study", slug = "old-study")
}