deploy
Deploy a repository as a new app in one call: a public one on any git host, or one of your own repos.
noclick.deploy copies the repository (or takes your repo as it is), makes the app, sets the secrets it reads,
gives it the key to your account it asks for (or has the deploy ask the account's owner), and deploys production.
Ask with dry_run=True first to see what it would do, what it would cost a month and what it asks of you, with
nothing made.
plan = noclick.deploy("https://github.com/acme/console", dry_run=True)
print(plan.runtime, f"${plan.estimate.monthly_usd:.2f} a month", plan.missing_secrets)
app = noclick.deploy("https://github.com/acme/console", secrets={"STRIPE_SECRET_KEY": "sk_live_..."}).wait()
print(app.url)noclick.deploy(
source, *, dry_run=False, ref=None, name=None, secrets=None, account_key=None,
key_spend_cap_usd_per_month=None, user=..., client=None
) -> DeployPlan | RepoDeployDeploy source as a new app of yours: a public git repository's https URL, on any host (copied into a new
repo of yours, the one branch it deploys), or one of your own repos (a Repo, its id or its name, deployed as
it is). ref names a branch, tag or full commit sha (the default branch otherwise).
It makes the app (name, or the repository's own name, or the first of name-2, name-3... free), sets the
secrets its noclick.json says its code reads (NoClick makes the ones marked generate; secrets brings
the rest, by name), gives the app the key to your account it asks for when account_key names exactly its
scopes (only you signed in, or a key holding keys:create; otherwise the deploy asks the account's owner, as
every deploy does), and deploys production.
Never a private repository, a URL with a login, an ssh:// or git@ address, or another account's repo:
push a private one to a repo of yours with git and deploy that. What can't deploy is refused before anything is
made. Needs the apps and repos scopes.
FalseNoneNoneNoneNoneNoneWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A RepoDeploy operation whose wait() gives a DeployResult (the app's url, where its key
stands, the passwords to read once); with dry_run=True, a DeployPlan of what it would do, what it
would cost a month and what it asks of you, with nothing made.
See what it would do first:
plan = noclick.deploy("https://github.com/acme/console", dry_run=True)
print(plan.runtime, f"${plan.estimate.monthly_usd:.2f} a month")
if plan.account_key:
for line in plan.account_key.can:
print("its key can", line["can"])
print("you set:", plan.missing_secrets)Then deploy it, bringing the secrets you set, and read the password NoClick made once:
done = noclick.deploy("https://github.com/acme/console",
secrets={"STRIPE_SECRET_KEY": "sk_live_..."}).wait()
print(done.url)
app = noclick.Project.from_id(done.project_id)
for name in done.to_reveal:
print(name, app.secrets.reveal(name))One of your own repos, as it is:
done = noclick.deploy("console", name="console-live").wait()DeployPlan
class DeployPlanWhat a deploy would do, with nothing made: noclick.deploy(..., dry_run=True).
| source | dict[str, Any] | What it read: |
| name | str | The app's name (and its copy's): the one you gave, or the first free one from the repository's. |
| runtime | str | None | Where the app would run ( |
| framework | str | None | |
| reason | str | None | |
| noclick_json | bool | Whether the repository has a noclick.json. |
| account_key | DeployKeyAsk | None | |
| secrets | list[DeploySecret] | |
| missing_secrets | list[str] | The secrets you set that the call would have to bring: a deploy without them is refused. |
| refused | dict[str, str] | None | Why it won't deploy as it stands ( |
| estimate | Estimate | What it would cost a month, priced for your account (usage-based: what's charged is what's used). |
| funds | dict[str, Any] | Whether your account can pay to run it now ( |
| makes | list[str] | What it makes: |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
DeployResult
class DeployResultA deploy that ended live: what RepoDeploy.wait() gives.
| project_id | str | |
| name | str | |
| url | str | None | Where production serves it. |
| repo_id | str | None | |
| deployment_id | str | None | |
| commit | str | None | |
| account_key | dict[str, Any] | None | Where its key to the account stands ( |
| to_reveal | list[str] | The passwords NoClick made that nobody has read yet: read each once with |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
DeploySecret
class DeploySecretA secret the repository's noclick.json says its code reads.
| name | str | |
| generate | str | None | What NoClick makes for it ( |
| description | str | None | What it is, in the repository's words. |
| required | bool | For one you set: whether a deploy without it is refused. One NoClick makes is always there. |
| given | bool | For one you set: whether the call brought its value. |
| shown_once | bool | For one NoClick makes: whether it's a password you read once ( |
DeployKeyAsk
class DeployKeyAskThe key to your account the repository asks for, as you're shown it before you agree.
| scopes | list[str] | |
| can | list[dict[str, Any]] | What the key can do, a line per scope ( |
| cannot | list[str] | What no app's key can do, whatever it holds. |
| note | str | That whoever can change the app's code acts with the key. |
| given_by | str |
|
| at_deploy | str | None | When the deploy asks: |
RepoDeploy
class RepoDeploy(Operation)A repository being deployed as a new app: the operation noclick.deploy returns. wait() gives a
DeployResult once it's live; progress shows each stage (copying, making the app, setting its secrets and
key, building and deploying). A deploy that fails after the copy keeps the app and its repo, and its error says
how to go on.
- Inherits from Operation.
| project_id | str | None | The new app's id, once it's made. |
| repo_id | str | None | The repo it deploys: the copy, or yours. |
| deployment_id | str | None | The production deployment, once it's started. |