chore: Rename "start" to "server" (#1110)

Workspace commands will be aliased at the top-level, so
"start" would easily be confused with starting a workspace.

Server seems like a more appropriate name too.
This commit is contained in:
Kyle Carberry 2022-04-23 12:19:20 -05:00 committed by GitHub
parent da3681246e
commit 3976994781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 19 deletions

View File

@ -43,7 +43,7 @@ func Root() *cobra.Command {
`,
Example: cliui.Styles.Paragraph.Render(`Start Coder in "dev" mode. This dev-mode requires no further setup, and your local `+cliui.Styles.Code.Render("coder")+` CLI will be authenticated to talk to it. This makes it easy to experiment with Coder.`) + `
` + cliui.Styles.Code.Render("$ coder start --dev") + `
` + cliui.Styles.Code.Render("$ coder server --dev") + `
` + cliui.Styles.Paragraph.Render("Get started by creating a template from an example.") + `
` + cliui.Styles.Code.Render("$ coder templates init"),
@ -63,7 +63,7 @@ func Root() *cobra.Command {
cmd.AddCommand(
configSSH(),
start(),
server(),
login(),
parameters(),
templates(),

View File

@ -43,7 +43,7 @@ import (
"github.com/coder/coder/provisionersdk/proto"
)
func start() *cobra.Command {
func server() *cobra.Command {
var (
accessURL string
address string
@ -67,7 +67,7 @@ func start() *cobra.Command {
)
root := &cobra.Command{
Use: "start",
Use: "server",
RunE: func(cmd *cobra.Command, args []string) error {
logger := slog.Make(sloghuman.Sink(os.Stderr))
if traceDatadog {

View File

@ -29,7 +29,7 @@ import (
// This cannot be ran in parallel because it uses a signal.
// nolint:tparallel
func TestStart(t *testing.T) {
func TestServer(t *testing.T) {
t.Run("Production", func(t *testing.T) {
t.Parallel()
if runtime.GOOS != "linux" || testing.Short() {
@ -41,7 +41,7 @@ func TestStart(t *testing.T) {
defer closeFunc()
ctx, cancelFunc := context.WithCancel(context.Background())
done := make(chan struct{})
root, cfg := clitest.New(t, "start", "--address", ":0", "--postgres-url", connectionURL)
root, cfg := clitest.New(t, "server", "--address", ":0", "--postgres-url", connectionURL)
go func() {
defer close(done)
err = root.ExecuteContext(ctx)
@ -72,7 +72,7 @@ func TestStart(t *testing.T) {
t.Parallel()
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
root, cfg := clitest.New(t, "start", "--dev", "--skip-tunnel", "--address", ":0")
root, cfg := clitest.New(t, "server", "--dev", "--skip-tunnel", "--address", ":0")
go func() {
err := root.ExecuteContext(ctx)
require.ErrorIs(t, err, context.Canceled)
@ -97,7 +97,7 @@ func TestStart(t *testing.T) {
t.Parallel()
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
root, _ := clitest.New(t, "start", "--dev", "--skip-tunnel", "--address", ":0",
root, _ := clitest.New(t, "server", "--dev", "--skip-tunnel", "--address", ":0",
"--tls-enable", "--tls-min-version", "tls9")
err := root.ExecuteContext(ctx)
require.Error(t, err)
@ -106,7 +106,7 @@ func TestStart(t *testing.T) {
t.Parallel()
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
root, _ := clitest.New(t, "start", "--dev", "--skip-tunnel", "--address", ":0",
root, _ := clitest.New(t, "server", "--dev", "--skip-tunnel", "--address", ":0",
"--tls-enable", "--tls-client-auth", "something")
err := root.ExecuteContext(ctx)
require.Error(t, err)
@ -115,7 +115,7 @@ func TestStart(t *testing.T) {
t.Parallel()
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
root, _ := clitest.New(t, "start", "--dev", "--skip-tunnel", "--address", ":0",
root, _ := clitest.New(t, "server", "--dev", "--skip-tunnel", "--address", ":0",
"--tls-enable")
err := root.ExecuteContext(ctx)
require.Error(t, err)
@ -126,7 +126,7 @@ func TestStart(t *testing.T) {
defer cancelFunc()
certPath, keyPath := generateTLSCertificate(t)
root, cfg := clitest.New(t, "start", "--dev", "--skip-tunnel", "--address", ":0",
root, cfg := clitest.New(t, "server", "--dev", "--skip-tunnel", "--address", ":0",
"--tls-enable", "--tls-cert-file", certPath, "--tls-key-file", keyPath)
go func() {
err := root.ExecuteContext(ctx)
@ -162,7 +162,7 @@ func TestStart(t *testing.T) {
}
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
root, cfg := clitest.New(t, "start", "--dev", "--skip-tunnel", "--address", ":0", "--provisioner-daemons", "0")
root, cfg := clitest.New(t, "server", "--dev", "--skip-tunnel", "--address", ":0", "--provisioner-daemons", "0")
done := make(chan struct{})
go func() {
defer close(done)
@ -204,7 +204,7 @@ func TestStart(t *testing.T) {
t.Parallel()
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
root, _ := clitest.New(t, "start", "--dev", "--skip-tunnel", "--address", ":0", "--trace-datadog=true")
root, _ := clitest.New(t, "server", "--dev", "--skip-tunnel", "--address", ":0", "--trace-datadog=true")
done := make(chan struct{})
go func() {
defer close(done)

View File

@ -1,4 +1,4 @@
# Run "coder start --help" for flag information.
# Run "coder server --help" for flag information.
CODER_ADDRESS=
CODER_PG_CONNECTION_URL=
CODER_TLS_CERT_FILE=

View File

@ -19,7 +19,7 @@ AmbientCapabilities=CAP_IPC_LOCK
CacheDirectory=coder
CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK CAP_NET_BIND_SERVICE
NoNewPrivileges=yes
ExecStart=/usr/bin/coder start
ExecStart=/usr/bin/coder server
Restart=on-failure
RestartSec=5
TimeoutStopSec=30

View File

@ -14,6 +14,6 @@ cd "${PROJECT_ROOT}"
(
trap 'kill 0' SIGINT
CODERV2_HOST=http://127.0.0.1:3000 INSPECT_XSTATE=true yarn --cwd=./site dev &
go run cmd/coder/main.go start --dev --skip-tunnel &
go run cmd/coder/main.go server --dev --skip-tunnel &
wait
)

View File

@ -17,14 +17,14 @@ Install [the latest release](https://github.com/coder/coder/releases).
To tinker, start with dev-mode (all data is in-memory, and is destroyed on exit):
```bash
$ coder start --dev
$ coder server --dev
```
To run a production deployment with PostgreSQL:
```bash
$ CODER_PG_CONNECTION_URL="postgres://<username>@<host>/<database>?password=<password>" \
coder start
coder server
```
To run as a system service, install with `.deb` or `.rpm`:

View File

@ -17,7 +17,7 @@ const config: PlaywrightTestConfig = {
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
webServer: {
// Run the coder daemon directly.
command: `go run -tags embed ${path.join(__dirname, "../../cmd/coder/main.go")} start --dev --skip-tunnel`,
command: `go run -tags embed ${path.join(__dirname, "../../cmd/coder/main.go")} server --dev --skip-tunnel`,
port: 3000,
timeout: 120 * 10000,
reuseExistingServer: false,