Project Scope
Graft is designed to be location-agnostic. While you usually run commands from within a specific project directory, the Project Scope flag allows you to manage your deployments from anywhere on your machine.
Project Scoping (-p, --project)
Section titled “Project Scoping (-p, --project)”The project flag tells Graft which project context to use. Instead of looking for a .graft folder in your current directory, Graft retrieves the project metadata and remote connection details from its global registry.
Examples:
Section titled “Examples:”Deploy from anywhere:
graft -p my-awesome-project syncCheck service status:
graft -p my-awesome-project psView remote logs:
graft -p my-awesome-project logs --tail=50Restart a specific service:
graft -p my-awesome-project restart webHost & Environment Passthrough
Section titled “Host & Environment Passthrough”You can also target the underlying host infrastructure for a specific project or environment directly using the host command. This acts as a wrapper for sudo docker on the remote server.
Project Host Passthrough: Execute a Docker command on the host of the specified project.
graft -p <project-name> host <command># Example:graft -p my-app host psEnvironment-Specific Host Passthrough: Target the host of a specific environment within a project.
graft -p <project-name> env <env-name> host <command># Example:graft -p my-app env staging host statsWhy use Project Scope?
Section titled “Why use Project Scope?”- Quick Management: No need to
cdinto multiple project folders to check status or restart services. - Automation: Easily script Graft commands in your local automation tools without worrying about the working directory.
- Global Access: Manage your entire fleet of projects from a single terminal session.