Add .sc.yml config and infer app/deployment from the checkout #7
No reviewers
Labels
No labels
⏳in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grey.ooo/someones.computer_agent!7
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/deployment-per-branch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every
scparameter can now be set four ways, resolving flag > environment >.sc.yml> detected default — and with none of them set,sc deployworks bare in a git checkout..sc.ymlThe per-project file: the nearest one searching upwards from the working directory (so it works from a subdirectory), or
--config <path>for a specific one..sc.yamlis accepted too; both in one directory is an error rather than a coin toss.Every key is a flag name, and unknown keys are rejected — a typo like
endpont:should fail loudly, not deploy somewhere unexpected. Relativefilesentries resolve against the file, not the working directory.filesaccepts a bare string as well as a list, andfile:is an accepted alias.Credentials follow the same chain:
--token>$SC_TOKEN>token:in.sc.yml> thesc loginstore. A token in the project file sits inside the build context and ships with the upload unless.dockerignoreexcludes it, soscwarns when it uses one.Detected defaults
app~/code/My Cool App→my-cool-appdeploymentfeature/New UI→feature-new-uiThe repository root is used, so
services/api/gives the same answer as the root. Git is read directly rather than shelled out to —scis a static binary and shouldn't need git onPATH— including a worktree's or submodule's.gitfile. A detached HEAD yields no deployment name (a commit id makes a poor one), and outside a checkout the working directory's name is used.--appis no longer a required flag, since it can now come from three other places. A run with nothing to infer from says so rather than printing usage.Deployment per branch
The resolved name goes on the wire as
manifest.deployment. The server side (platform PR) treats it as part of the bundle's identity, so the same tree pushed from a second branch is a new revision rather than a 409 duplicate; re-pushing the same tree on the same branch still conflicts as before.Verification
go vet ./...andgo test ./...are green. New tests cover the precedence chain for every parameter (including all four credential sources),.sc.ymldiscovery/strictness/aliases, and directory/branch detection through both a.gitdirectory and a worktree's.gitfile.Run against the local stack (
:7650), the same tree under two names:And bare, with no arguments at all, in a checkout:
Notes for the reviewer
gopkg.in/yaml.v3(promoted from indirect).client.UploadBundlegained adeploymentparameter — it is omitted from the JSON when empty, so an unnamed upload is byte-identical to before.