Skip to content

Commit

Permalink
fix: add git sync and push namespacefiles example
Browse files Browse the repository at this point in the history
  • Loading branch information
wrussell1999 committed Nov 12, 2024
1 parent 8e37e4a commit f2781ef
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion content/docs/05.concepts/02.namespace-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,53 @@ tasks:

The `Execute` button allows you to run your flow directly from the Code Editor. Click on the `Execute` button to run your flow. You should then see the Execution being created in a new browser tab and once you navigate to the `Logs` tab, you should see a friendly message ``Hello from the Editor!`` in the logs.

### PushNamespaceFiles and SyncNamespaceFiles Tasks

There's 2 tasks to help you automatically manage your namespace files with Git. This allows you to sync the latest changes from a Git repository.

This example will push Namespace Files you already have in Kestra to a Git repository for you:

```yaml
id: push_to_git
namespace: system
tasks:
- id: commit_and_push
type: io.kestra.plugin.git.PushNamespaceFiles
username: git_username
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
url: https://github.com/git_username/scripts
branch: dev
namespace: company.team
files:
- "example.py"
gitDirectory: _files
commitMessage: "add namespace files"
dryRun: true
```

This example will sync Namespace Files inside of a Git repository to your Kestra instance:

```yaml
id: sync_files_from_git
namespace: system
tasks:
- id: sync_files
type: io.kestra.plugin.git.SyncNamespaceFiles
username: git_username
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
url: https://github.com/git_username/scripts
branch: main
namespace: git
gitDirectory: _files
dryRun: true
```

Check out the dedicated guides for more information:
- [PushNamespaceFiles](../15.how-to-guides/pushnamespacefiles.md)
- [SyncNamespaceFiles](../15.how-to-guides/syncnamespacefiles.md)

### GitHub Actions CI/CD

You can leverage our official GitHub Action called [deploy-action](https://github.com/kestra-io/deploy-action) to synchronize your Git repository with a given namespace. This is useful if you want to orchestrate complex Python modules, dbt projects, Terraform or Ansible infrastructure, or any other project that contains code and configuration files with potentially multiple nested directories and files.
Expand Down Expand Up @@ -121,7 +168,6 @@ jobs:
When creating a service account role for the GitHub Action in the [Enterprise Edition](../06.enterprise/index.md), you need to grant the `FLOWS` permission to the Role.
::


### Terraform Provider

You can use the `kestra_namespace_file` resource from the official [Kestra Terraform Provider](https://registry.terraform.io/providers/kestra-io/kestra/latest/docs) to deploy all your custom script files from a specific directory to a given Kestra namespace.
Expand Down

0 comments on commit f2781ef

Please sign in to comment.