LocalRegistry.LocalRegistryModule

LocalRegistry

Create and maintain local registries for Julia packages. This package is intended to provide a simple but manual workflow for maintaining small local registries (private or public) without making any assumptions about how the registry or the packages are hosted.

Registry creation is done by the function create_registry.

Registration of new and updated packages is done by the function register.

LocalRegistry.create_registryMethod
create_registry(name, repo)
create_registry(path, repo)

Create a registry with the given name or at the local directory path, and with repository URL or path repo. The first argument is interpreted as a path if it has more than one path component and otherwise as a name. If a path is given, the last path component is used as the name of the registry. If a name is given, it is created in the standard registry location. In both cases the registry path must not previously exist. The repository must be able to be pushed to, for example by being a bare repository.

Keyword arguments

create_registry(...; description = nothing, push = false,
                branch = nothing, gitconfig = Dict())
  • description: Optional description of the purpose of the registry.
  • push: If false, the registry will only be prepared locally. Review the result and git push it manually. If true, the upstream repository is first cloned (if possible) before creating the registry.
  • branch: Create the registry in the specified branch. Default is to use the upstream branch if push is true and otherwise the default branch name configured for git init.
  • gitconfig: Optional configuration parameters for the git command.
LocalRegistry.registerFunction
register(package; registry = registry)
register(package)
register()

Register package. If package is omitted, register the package in the currently active project or in the current directory in case the active project is not a package.

If registry is not specified:

  • For registration of a new version, automatically locate the registry where package is available.
  • For registration of a new package, fail unless exactly one registry other than General is installed, in which case that registry is used.

Notes:

  • By default this will, in all cases, git push the updated registry to its remote repository. If you prefer to do the push manually, use the keyword argument push = false.
  • The package must live in a git working copy, e.g. having been cloned by Pkg.develop.

package can be specified in the following ways:

  • By package name. The package must be available in the active Pkg environment.
  • By path. This is distinguished from package name by having more than one path component. A path in the current working directory can be specified by starting with "./".
  • By module. It needs to first be loaded by using or import.

registry can be specified in the following ways:

  • By registry name. This must be an exact match to the name of one of the installed registries.
  • By path. This must be an existing local path.
  • By URL to its remote location. Everything which doesn't match one of the previous options is assumed to be a URL.

If registry is specified by URL, or the found registry is not a git clone (i.e. obtained from a package server), a temporary git clone will be used to perform the registration. In this case push must be true.

Keyword arguments

register(package; registry = nothing, commit = true, push = true,
         branch = nothing, repo = nothing, ignore_reregistration = false,
         gitconfig = Dict(), create_gitlab_mr = false)
  • registry: Name, path, or URL of registry.
  • commit: If false, only make the changes to the registry but do not commit. Additionally the registry is allowed to be dirty in the false case.
  • push: If true, push the changes to the registry repository automatically. Ignored if commit is false.
  • branch: Branch name to use for the registration.
  • repo: Specify the package repository explicitly. Otherwise looked up as the git remote of the package the first time it is registered.
  • ignore_reregistration: If true, do not raise an error if a version has already been registered (with different content), only an informational message.
  • gitconfig: Optional configuration parameters for the git command.
  • create_gitlab_mr: If true sends git push options to create a GitLab merge request. Requires commit and push to be true.