PushNamespaceFiles
PushNamespaceFiles
type: "io.kestra.plugin.git.PushNamespaceFiles"
Commit and push Namespace Files created from kestra UI to Git.
Using this task, you can push one or more Namespace Files from a given kestra namespace to Git. Check the Version Control with Git documentation for more details.
Examples
Push all saved Namespace Files from the dev namespace to a Git repository every 15 minutes.
id: push_to_git
namespace: system
tasks:
- id: commit_and_push
type: io.kestra.plugin.git.PushNamespaceFiles
namespace: dev
files: "**" # optional list of glob patterns; by default, all files are pushed
gitDirectory: _files # optional path in Git where Namespace Files should be pushed
url: https://github.com/kestra-io/scripts # required string
username: git_username # required string needed for Auth with Git
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
branch: dev # optional, uses "kestra" by default
commitMessage: "add namespace files" # optional string
dryRun: true # if true, you'll see what files will be added, modified or deleted based on the state in Git without overwriting the files yet
triggers:
- id: schedule_push_to_git
type: io.kestra.plugin.core.trigger.Schedule
cron: "*/15 * * * *"
Properties
authorEmail
- Type: string
- Dynamic: ✔️
- Required: ❌
The commit author email.
If null, no author will be set on this commit.
authorName
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
username
The commit author name.
If null, the username will be used instead.
branch
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
kestra
The branch to which Namespace Files should be committed and pushed.
If the branch doesn’t exist yet, it will be created. If not set, the task will push the files to the
kestra
branch.
cloneSubmodules
- Type: boolean
- Dynamic: ❌
- Required: ❌
Whether to clone submodules.
commitMessage
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
Add files from
namespacenamespace
Git commit message.
dryRun
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
false
If true
, the task will only output modifications without pushing any file to Git yet. If false
(default), all listed files will be pushed to Git immediately.
files
- Type: object
- Dynamic: ✔️
- Required: ❌
- Default:
**
Which Namespace Files should be included in the commit.
By default, Kestra will push all Namespace Files from the specified namespace. If you want to push only a specific file or directory e.g. myfile.py, you can set it explicitly using files: myfile.py. Given that this is a glob pattern string (or a list of glob patterns), you can include as many files as you wish, provided that the user is authorized to access that namespace. Note that each glob pattern try to match the file name OR the relative path starting from
gitDirectory
gitDirectory
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
_files
Directory to which Namespace Files should be pushed.
If not set, files will be pushed to a Git directory named _files. See the table below for an example mapping of Namespace Files to Git paths:
Namespace File Path | Git directory path |
---|---|
scripts/app.py | _files/scripts/app.py |
scripts/etl.py | _files/scripts/etl.py |
queries/orders.sql | _files/queries/orders.sql |
queries/customers.sql | _files/queries/customers.sql |
requirements.txt | _files/requirements.txt |
namespace
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
{{ flow.namespace }}
The namespace from which files should be pushed to the gitDirectory
.
passphrase
- Type: string
- Dynamic: ✔️
- Required: ❌
The passphrase for the privateKey
.
password
- Type: string
- Dynamic: ✔️
- Required: ❌
The password or Personal Access Token (PAT). When you authenticate the task with a PAT, any flows or files pushed to Git from Kestra will be pushed from the user associated with that PAT. This way, you don't need to configure the commit author (the authorName
and authorEmail
properties).
privateKey
- Type: string
- Dynamic: ✔️
- Required: ❌
PEM-format private key content that is paired with a public key registered on Git.
To generate an ECDSA PEM format key from OpenSSH, use the following command:
ssh-keygen -t ecdsa -b 256 -m PEM
. You can then set this property with your private key content and put your public key on Git.
url
- Type: string
- Dynamic: ✔️
- Required: ❌
The URI to clone from.
username
- Type: string
- Dynamic: ✔️
- Required: ❌
The username or organization.
Was this page helpful?