Skip to content

Commit 8db36d6

Browse files
committed
better documentation for multi-git-sync
1 parent db8ecbd commit 8db36d6

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

docs/modules/airflow/pages/usage-guide/mounting-dags.adoc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ See the xref:usage-guide/applying-custom-resources.adoc[] example for more detai
8585

8686
=== Multiple repositories via git-sync
8787

88-
If you want to access multiple branches of a repository or load dags from multiple repositories, you can extend the list shown above. Those repositories get consolidated beneath `stackable/app/allDAGs/current-i`, where `i` is the position in the list ranging from (0,1,..,n-1).
88+
If you want to access multiple branches of a repository or load dags from multiple repositories, you can extend the list shown above.
89+
90+
The default mount-path for git-sync resources is `/stackable/app/allDAGs/current-{i}` where i corresponds to:
91+
92+
[source,yaml]
93+
----
94+
dagsGitSync:
95+
- repo: ssh://git@github.com/stackable-airflow/dags.git # <-- current-0
96+
branch: test/git-sync-0
97+
credentials:
98+
sshPrivateKeySecretName: git-sync-ssh
99+
- repo: ssh://git@github.com/stackable-airflow/dags.git # <-- current-1
100+
branch: test/git-sync-1
101+
credentials:
102+
sshPrivateKeySecretName: git-sync-ssh
103+
----
89104

90105
NOTE: Using DAG's from ConfigMaps will need you to either use celeryExecutors and mount them under `/stackable/app/allDAGs/<name>` or use kubernetesExecutor and mount them somewhere else and change the PYTHONPATH as well as the `AIRFLOW\__CORE__DAGS_FOLDER` accordingly.

tests/templates/kuttl/mount-dags-gitsync/30-install-airflow-cluster.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ spec:
8282
sshPrivateKeySecretName: git-sync-ssh
8383
- repo: ssh://git@github.com/stackable-airflow/dags.git
8484
branch: test/git-sync-1
85+
credentials:
86+
sshPrivateKeySecretName: git-sync-ssh
8587
{% endif %}
8688
{% if test_scenario['values']['access'] == 'https' %}
8789
- repo: https://github.com/stackable-airflow/dags
@@ -90,6 +92,8 @@ spec:
9092
basicAuthSecretName: git-credentials
9193
- repo: https://github.com/stackable-airflow/dags
9294
branch: test/git-sync-1
95+
credentials:
96+
basicAuthSecretName: git-credentials
9397
{% endif %}
9498
{% if test_scenario['values']['executor'] == 'celery' %}
9599
# Just setting some values to increase the test coverage (defaults should work just fine)

0 commit comments

Comments
 (0)