这是indexloc提供的服务,不要输入任何密码
Skip to content

Improve and document login --sso-team #953

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

Merged
merged 5 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/internal/login/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os/exec"
"path/filepath"
"strings"

"github.com/vercel/turborepo/cli/internal/client"
"github.com/vercel/turborepo/cli/internal/config"
"github.com/vercel/turborepo/cli/internal/fs"
Expand Down Expand Up @@ -161,7 +162,7 @@ func (c *LinkCommand) Run(args []string) int {
}

c.Ui.Info("")
c.Ui.Info(util.Sprintf("%s${RESET} Turborepo CLI authorized for ${BOLD}%s${RESET}", ui.Rainbow(">>> Success!"), chosenTeam.Name))
c.Ui.Info(util.Sprintf("%s${RESET} Turborepo CLI authorized for ${BOLD}%s${RESET}", ui.Rainbow(">>> Success!"), chosenTeamName))
c.Ui.Info("")
c.Ui.Info(util.Sprintf("${GREY}To disable Remote Caching, run `npx turbo unlink`${RESET}"))
c.Ui.Info("")
Expand Down
9 changes: 9 additions & 0 deletions cli/internal/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ func loginSSO(c *config.Config, ssoTeam string, deps loginDeps) error {
if err != nil {
return errors.Wrap(err, "failed to save teamId")
}
deps.ui.Info(util.Sprintf("${CYAN}Remote Caching enabled for %s${RESET}", ssoTeam))
deps.ui.Info("")
deps.ui.Info(" Remote Caching shares your cached Turborepo task outputs and logs across")
deps.ui.Info(" all your team’s Vercel projects. It also can share outputs")
deps.ui.Info(" with other services that enable Remote Caching, like CI/CD systems.")
deps.ui.Info(" This results in faster build times and deployments for your team.")
deps.ui.Info(util.Sprintf(" For more info, see ${UNDERLINE}https://turborepo.org/docs/features/remote-caching${RESET}"))
deps.ui.Info("")
deps.ui.Info(util.Sprintf("${GREY}To disable Remote Caching, run `npx turbo unlink`${RESET}"))
} else {

deps.ui.Info(util.Sprintf("${CYAN}To connect to your Remote Cache. Run the following in the${RESET}"))
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,10 @@ rm -rf ./node_modules/.cache/turbo
```

Now run the same build again. If things are working properly, `turbo` should not execute tasks locally, but rather download both the logs and artifacts from your Remote Cache and replay them back to you.

<Callout>
**Note: When connecting to an sso-enabled Vercel team, you must provide your Team slug as an argument to `npx turbo login`.**
</Callout>
```
npx turbo login --sso-team=<team-slug>
```
10 changes: 10 additions & 0 deletions docs/pages/docs/reference/command-line-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,16 @@ Defaults to `https://vercel.com`.

Defaults to `https://vercel.com/api`.

#### `--sso-team`

`type: string`

Connect to an sso-enabled Vercel team by providing your Team slug.

```
turbo login --sso-team=<team-slug>
```

## `turbo logout`

Logs you out of your Vercel account.
Expand Down