Skip to content

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

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 1 commit into from
Apr 23, 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
4 changes: 2 additions & 2 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -63,7 +63,7 @@ func Root() *cobra.Command {

cmd.AddCommand(
configSSH(),
start(),
server(),
login(),
parameters(),
templates(),
Expand Down
4 changes: 2 additions & 2 deletions cli/start.go → cli/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
"github.com/coder/coder/provisionersdk/proto"
)

func start() *cobra.Command {
func server() *cobra.Command {
var (
accessURL string
address string
Expand All @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions cli/start_test.go → cli/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion coder.env
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
2 changes: 1 addition & 1 deletion coder.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
2 changes: 1 addition & 1 deletion site/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down