Skip to content
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ $(BUILDDIR)/tctl:
$(BUILDDIR)/teleport: ensure-webassets bpf-bytecode rdpclient
GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -tags "webassets_embed $(PAM_TAG) $(FIPS_TAG) $(BPF_TAG) $(WEBASSETS_TAG) $(RDPCLIENT_TAG) $(PIV_BUILD_TAG)" -o $(BUILDDIR)/teleport $(BUILDFLAGS) ./tool/teleport

TELEPORT_ARGS ?= start
.PHONY: teleport-hot-reload
teleport-hot-reload:
CompileDaemon --graceful-kill=true --exclude-dir=".git" --exclude-dir="node_modules" --build="make $(BUILDDIR)/teleport" --command="$(BUILDDIR)/teleport $(TELEPORT_ARGS)"

# NOTE: Any changes to the `tsh` build here must be copied to `windows.go` in Dronegen until
# we can use this Makefile for native Windows builds.
.PHONY: $(BUILDDIR)/tsh
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,41 @@ sudo mkdir -p -m0700 /var/lib/teleport
sudo chown $USER /var/lib/teleport
```

#### Running Teleport in a hot reload mode

To speed up your development process, you can run Teleport using
[`CompileDaemon`](https://github.com/githubnemo/CompileDaemon). This will build
and run the Teleport binary, and then rebuild and restart it whenever any Go
source files change.

1. Install CompileDaemon:

```shell
go install github.com/githubnemo/CompileDaemon@latest
```

Note that we use `go install` instead of the suggested `go get`, because we
don't want CompileDaemon to become a dependency of the project.

1. Build and run the Teleport binary:

```shell
make teleport-hot-reload
```

By default, this runs a `teleport start` command. If you want to customize
the command, for example by providing a custom config file location, you can
use the `TELEPORT_ARGS` parameter:

```shell
make teleport-hot-reload TELEPORT_ARGS='start --config=/path/to/config.yaml'
```

Note that you still need to run [`make grpc`](api/proto/README.md) if you modify
any Protocol Buffers files to regenerate the generated Go sources; regenerating
these sources should in turn cause the CompileDaemon to rebuild and restart
Teleport.

### Web UI

The Teleport Web UI resides in the [web](web) directory.
Expand Down