Copy build output to a fixed folder
When another program loads a folder your service builds from a path it remembers, such as a browser with an unpacked extension, devlanes can copy that folder to a fixed place and keep the copy current while the service runs.
::example{slug="remote-docker-box"}
Add the folder to the service
Section titled “Add the folder to the service”services: web: run_script: file: web/package.json name: dev sync: - from: web/.output/chrome-mv3 to: ${{ lane.data_path }}/chrome-mv3 ignore: ["*.map"]servicesLong-running processes of each lane, started together after infrastructure, setup and lane.start tasks. Each service gets its own port as PORT and, with hosts, HTTPS hostnames. A service that exits shows as failed and is not restarted.
services.<name>A long-running process started with the lane, such as a dev server or a worker. Each service gets its own port from the lane's block (PORT, ${{ self.port }}); devlanes stops it with the lane and never restarts it when it exits. A service needs run or run_script, directly or through extends.
services.<name>.run_scriptScript to run from a project file, as { file, name }, such as { file: apps/api/package.json, name: dev }. devlanes picks the tool from the file name (package.json, Makefile, justfile, Taskfile.yml, deno.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, build.gradle(.kts), settings.gradle(.kts)), runs the script in that file's directory and checks that it exists before starting. For Maven and Gradle, name is the arguments as typed after mvn or gradle, and Maven or Gradle reports a goal or task that does not exist. Presets need it to place their flags, and a profile's run_scripts can swap the script name. Exactly one of run and run_script is required after templates are applied.
services.<name>.run_script.fileFile that defines the script, relative to the project file's directory, such as apps/api/package.json. The script runs in this file's directory. Required unless an override or extends child keeps the inherited file.
services.<name>.run_script.nameScript, target, recipe, task, binary or package name in that file. For go.mod, a bare name such as api means ./cmd/api, and . or a path with / is relative to go.mod. For pom.xml and Gradle files it is the arguments as typed after mvn or gradle, such as -pl web -am spring-boot:run or :web:bootRun; quote an argument that contains spaces, as in a shell. It must name at least one goal or task. Required unless an override or extends child keeps the inherited name.
services.<name>.syncFolders mirrored while the service runs, such as build output a browser loads unpacked from a fixed path. Each entry copies from to to (default ~/devlanes/sync/<project>/<lane>/<folder>) and follows changes; machines connected with devlanes remote connect get their own copy.
services.<name>.sync[].fromFolder to copy, relative to the project file's directory in the lane's worktree.
Config referenceservices.<name>.sync[].toLocal destination; ~/ is your home and other relative paths start at the project file's directory. Defaults to ~/devlanes/sync/<project>/<lane>/<folder>. Machines connected with devlanes remote connect ignore it and use their own path.
services.<name>.sync[].ignoreGlob patterns of files left out of the copy and of later updates.
Config referenceThe source path starts at the project file’s folder. The destination here is in the lane’s data folder, a folder devlanes keeps for each lane outside the worktree, so each lane has its own copy. The copy starts with the service, so restart a service that already runs:
$ devlanes restart web --no-uiLoad the copy
Section titled “Load the copy”This prints the lane’s data folder as DEVLANES_LANE_DATA; the copy is the chrome-mv3 folder inside it:
$ devlanes env show webPoint the browser at that folder once. It stays current across rebuilds and restarts, and cleaning the lane deletes it. Leave the empty .devlanes-sync file in it; it marks the folder as devlanes’ own.
If you want another destination
Section titled “If you want another destination”Give an absolute path, or one relative to the project file’s folder. A path that starts with ~/ and the default destination need the HOME variable, which PowerShell and cmd do not set.
If the service runs on a box
Section titled “If the service runs on a box”When your machine is connected to a box, another machine whose lanes you open from yours, it gets its own copy in the devlanes home under the box’s name, and ignores the destination in the project file. Remote mirroring covers it.