Description #
The git
remote uses git to publish the outputs of the
backup process.
This handler will fetch the remote shallowly on the specified branch, add all files (respecting the original directory structure) commit, then push them to the remote.
Configuration #
{
"remotes": [
{
"name": "myRemote",
"type": "GIT",
"url": "https://github.com/foo/bar.git",
"branch": "main",
"credentials": {
"username": "bob",
"password": "Password123"
}
}
],
"sources": [
{
"name": "source-with-inline-git-remote",
// ...
"remotes": [
{
"name": "myRemote",
"type": "GIT",
"url": "git@github.com:foo/bar.git",
"branch": "main",
// no credentials provided
}
]
},
{
"name": "source-with-global-git-remote",
// ...
"remotes": [
"myRemote"
]
}
]
}
Available configuration options #
name #
- required
The name of the source. This has to be a valid identifier.
type #
- required
- constant
A constant that tells the engine what kind of remote this object is. This must be set to "GIT"
.
url #
- required
- template enabled
The git remote URL. This can be either HTTP or SSH.
branch #
- required
- template enabled
The repository branch to be used for backup.
commitMessagePattern #
- default value
- template enabled
Pattern used for the commit message. Supports templating with context. Defaults to "Automatic backup"
.
disabled #
- default value
Whether to ignore this source during the backup process. Defaults to false
.
credentials #
Credentials to authenticate to the remote.
Valid credentials #
None #
When defining this remote, defining the none credential, or not providing any credentials will attempt to use the default git behaviour.
Basic #
Basic credentials can be provided.
Context #
The field templating context extends the default context with additional values:
Variable | Description |
---|---|
context.sourceName |
Name of current source |