Waypoint enables you to execute commands in the context of a deployed application. This can be used to open up a shell for debugging, execute database migrations, and more.
This functionality requires the Waypoint entrypoint.
»Using the CLI
waypoint exec command can be used to execute a command in the context
of a deployed application. The example below shows exec being used to open a
$ waypoint exec bash# echo foofoo
This is useful for debugging a deployment that may not be behaving as expected. You can also run one-off commands that aren't interactive:
$ waypoint exec rake db:migrate...
This is useful for executing scripts in the context of the application environment. This makes things like environment variables and other secrets typically available.
waypoint exec is called in an interactive terminal (versus a script),
information about your terminal will be sent to the remote end. This enables
vim or other terminal UIs to work as normal. Waypoint also
sends terminal resize events so everything should behave correctly even as you
resize your terminal.
waypoint exec works by picking a random running instance of the latest
deployment and executing within that environment. Exec does not spin up
a new dedicated instance. Please keep this in mind if you need to run
resource intensive tasks since user traffic may be sharing the same instance.
A future version of Waypoint will enable targeting specific deployments and instances. We will also enable an option to deploy a special exec-only instance so resources aren't shared.
Currently, exec can only be disabled by disabling the Waypoint entrypoint completely or by disabling only the exec functionality of the entrypoint. Please see the linked documentation for more information.
In the future, we'd like to support disabling exec using user policy, but this functionality is not available today.