io.warp10:warp10-ext-git

Installation

$ wf g -w /path/to/warp10 io.warp10 warp10-ext-git

/path/to/warp10/ is where Warp 10 is physically located.

Readme

Git WarpScript Extension

The warp10-ext-git extension adds functions to interact with Git repositories.

The repositories the functions can interact with must reside in a directory configured in your Warp 10 configuration under key git.root. This directory can contain symbolic links pointing to the actual repositories.

The functions provided by this extension do not aim at implementing all the features of Git, instead they are meant to simply allow a Warp 10 instance to store, load and list files maintained in a Git repository.

The functions rely on the capability mechanism introduced in Warp 10 2.7.2, so make sure you run a compatible version of Warp 10 before installing this extension.

Configuration

The extension must first be declared in the configuration:

warpscript.extension.git = io.warp10.ext.git.GitWarpScriptExtension

Then the root directory where the extension expects to find the repository must be configured:

git.root = /path/to/git/root

Restart your Warp 10 instance, the extension will be loaded and its functions available.

Token capabilities

Access rights are governed by token capabilities. The following capabilities are defined:

CapabilityToken attributeDescription
git.repo.cap:git.repoThe name of the repository the token grants access to. This is the name of the link or directory present in the directory pointed to by git.root.
git.name.cap:git.nameThe name which will appear in commit messages for operations which modify a repository. If unset, warp10-ext-git will be used.
git.email.cap:git.emailThe email address appearing in commit messages. If unset contact@senx.io will be used.
git.subdir.cap:git.subdirSubdirectory of git.repo that this token grants access to, the rest of the repository will be invisible. Paths provided to or returned by functions are relative to this subdirectory.
git.ro.cap:git.roIf this attribute is present, whatever the associated value, access to the repository is read only.

In order to use the functions from this extension, you must first add the capabilities from a token to your execution environment via the CAPADD function:

'TOKEN_WITH_CAPABILITIES' CAPADD

then the GIT* functions can be used and interact with the repository for which capabilities are available.

Functions

The extension adds the following functions to the WarpScript language. The detailed documentation for each is available in dedicated pages.

GITSTORE

Store some content in a file in a repository.

GITRM

Remove files from a repository.

GITLOAD

Retrieve data from a file in a repository.

GITFIND

Find files matching a regular expression in a repository.

GITTAG

Adds a tag to a repository.

Author
Avatar

SenX

contact@senx.io

Version

1.0.1-uberjar

Type

Extension

Last published

2021-06-04

License

Apache-2.0

Downloads
Repository

Github

Tags
git
Path Size Creation time
  GITFIND 1710 bytes 2021-06-02
  GITLOAD 1930 bytes 2021-06-02
  GITLOG 2523 bytes 2021-06-02
  GITRM 1798 bytes 2021-06-02
  GITSTORE 2295 bytes 2021-06-03
  GITTAG 1987 bytes 2021-06-02
Versions Published
1.0.1-uberjar 2021-06-04