Skip to main content

Host

API reference

Information about the host environment.

Implements Node

findUp(name: String!, noCache: Boolean = false): String

Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null

name: String!

name of the file or directory to search for

noCache: Boolean = false

id: ID!

A unique identifier for this Host.

containerImage(name: String!): Container!

Accesses a container image on the host.

name: String!

Name of the image to access.

directory(path: String!,exclude: [String!] = [],include: [String!] = [],noCache: Boolean = false,gitignore: Boolean = false): Directory!

Accesses a directory on the host.

path: String!

Location of the directory to access (e.g., ".").

exclude: [String!] = []

Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).

include: [String!] = []

Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).

noCache: Boolean = false

If true, the directory will always be reloaded from the host.

gitignore: Boolean = false

Apply .gitignore filter rules inside the directory

file(path: String!, noCache: Boolean = false): File!

Accesses a file on the host.

path: String!

Location of the file to retrieve (e.g., "README.md").

noCache: Boolean = false

If true, the file will always be reloaded from the host.

service(ports: [PortForward!]!, host: String = "localhost"): Service!

Creates a service that forwards traffic to a specified address via the host.

ports: [PortForward!]!

Ports to expose via the service, forwarding through the host network.

If a port's frontend is unspecified or 0, it defaults to the same as the backend port.

An empty set of ports is not valid; an error will be returned.

host: String = "localhost"

Upstream host to forward traffic to.

tunnel(service: Service!,native: Boolean = false,ports: [PortForward!] = []): Service!

Creates a tunnel that forwards traffic from the host to a service.

service: Service!

Service to send traffic from the tunnel.

native: Boolean = false

Map each service port to the same port on the host, as if the service were running natively.

Note: enabling may result in port conflicts.

ports: [PortForward!] = []

Configure explicit port forwarding rules for the tunnel.

If a port's frontend is unspecified or 0, a random port will be chosen by the host.

If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.

If ports are given and native is true, the ports are additive.

unixSocket(path: String!): Socket!

Accesses a Unix socket on the host.

path: String!

Location of the Unix socket (e.g., "/var/run/docker.sock").

References

Returned by