Codumentor logo Codumentor

FileSync Plugin

Adds a filesync repository type that copies source from a local directory or a Windows SMB/UNC share into Codumentor's repos directory before ingestion. Use it when the code lives on a shared drive rather than a Git host.

SMB/UNC support uses the smbprotocol package, which is part of the Codumentor install.

Configuration

Register the plugin (no args are required):

plugins:
  - module: codumentor.plugins.filesync
    class: FileSyncPlugin

Optional plugin args:

KeyTypeDefaultDescription
target_rootstringthe instance repos_dirBase directory that synced repos are copied into

Declare repositories with scm: filesync:

repos:
  - name: my-project
    scm: filesync
    path: /mnt/shared/projects/my-project

  - name: legacy-app
    scm: filesync
    path: "\\\\fileserver\\projects\\legacy-app"
    options:
      username: "domain\\user"
      password: "${SMB_PASSWORD}"

  - name: another-app
    scm: filesync
    path: "smb://fileserver/projects/another-app"
    options:
      username: user
      password: "${SMB_PASSWORD}"
      clear_target: false

Repository fields

FieldTypeDefaultDescription
pathstringSource directory, UNC path (\\server\share\...), or smb://server/share/... URL. ${ENV_VAR} expansion is supported.
options.usernamestringSMB username (${ENV_VAR} expansion supported)
options.passwordstringSMB password (${ENV_VAR} expansion supported)
options.clear_targetbooltrueDelete the destination before copying. Set false to keep files that were removed from the source.
options.target_dirstring<repos_dir>/<name>Override the destination path

Behaviour

On ingestion, each filesync repo is copied from the source to the target, then ingested from that local copy. Both a directory and a single file are accepted as the source.

Local paths, \\server\share\path UNC paths, and smb://server/share/path URLs all work. Credentials, when given, are used for the SMB server in the path.