|
| 1 | +######################################## |
| 2 | +# GitLab Source Configuration Examples |
| 3 | +######################################## |
| 4 | + |
| 5 | +# Global GitLab server configurations |
| 6 | +# These can be referenced in individual source configurations |
| 7 | +settings: |
| 8 | + gitlab: |
| 9 | + servers: |
| 10 | + # Default configuration for gitlab.com |
| 11 | + default: |
| 12 | + url: https://gitlab.com |
| 13 | + token: ${GITLAB_TOKEN} |
| 14 | + |
| 15 | + # Company self-hosted GitLab instance |
| 16 | + company: |
| 17 | + url: https://gitlab.example.com |
| 18 | + token: ${COMPANY_GITLAB_TOKEN} |
| 19 | + headers: |
| 20 | + X-Custom-Header: "custom-value" |
| 21 | + |
| 22 | + # Another GitLab instance with custom headers |
| 23 | + internal: |
| 24 | + url: https://gitlab.internal.org |
| 25 | + token: ${INTERNAL_GITLAB_TOKEN} |
| 26 | + headers: |
| 27 | + X-Api-Version: "2" |
| 28 | + X-Organization-ID: "org123" |
| 29 | + |
| 30 | +# Document configurations |
| 31 | +documents: |
| 32 | + # Example 1: Basic GitLab source with direct configuration |
| 33 | + - description: Basic GitLab Source Example |
| 34 | + outputPath: docs/generated/basic-gitlab-example.md |
| 35 | + sources: |
| 36 | + - type: gitlab |
| 37 | + description: Public GitLab Repository |
| 38 | + repository: namespace/project-name |
| 39 | + branch: main |
| 40 | + sourcePaths: |
| 41 | + - src |
| 42 | + gitlabToken: ${GITLAB_TOKEN} |
| 43 | + showTreeView: true |
| 44 | + |
| 45 | + # Example 2: Using a reference to a pre-configured server |
| 46 | + - description: Using GitLab Server Configuration |
| 47 | + outputPath: docs/generated/company-gitlab-example.md |
| 48 | + sources: |
| 49 | + - type: gitlab |
| 50 | + description: Internal Company GitLab Repository |
| 51 | + server: company # References the 'company' server in settings |
| 52 | + repository: internal/project |
| 53 | + branch: develop |
| 54 | + sourcePaths: |
| 55 | + - src/core |
| 56 | + - src/modules |
| 57 | + filePattern: "*.php" |
| 58 | + showTreeView: true |
| 59 | + |
| 60 | + # Example 3: Multiple GitLab sources with different filtering |
| 61 | + - description: Multiple GitLab Sources with Filtering |
| 62 | + outputPath: docs/generated/filtered-gitlab-example.md |
| 63 | + sources: |
| 64 | + # Source 1: Controllers only |
| 65 | + - type: gitlab |
| 66 | + description: Controllers |
| 67 | + server: internal |
| 68 | + repository: app/backend |
| 69 | + branch: feature/api-refactor |
| 70 | + sourcePaths: |
| 71 | + - src/Controllers |
| 72 | + filePattern: "*Controller.php" |
| 73 | + |
| 74 | + # Source 2: Models from the same repository |
| 75 | + - type: gitlab |
| 76 | + description: Models |
| 77 | + server: internal |
| 78 | + repository: app/backend |
| 79 | + branch: feature/api-refactor |
| 80 | + sourcePaths: |
| 81 | + - src/Models |
| 82 | + filePattern: "*.php" |
| 83 | + notPath: |
| 84 | + - "*Test.php" |
| 85 | + - "*Factory.php" |
| 86 | + |
| 87 | + # Example 4: Advanced filtering with content matching |
| 88 | + - description: Advanced GitLab Content Filtering |
| 89 | + outputPath: docs/generated/advanced-gitlab-filtering.md |
| 90 | + sources: |
| 91 | + - type: gitlab |
| 92 | + description: Service Classes |
| 93 | + repository: app/services |
| 94 | + server: internal |
| 95 | + sourcePaths: |
| 96 | + - src |
| 97 | + filePattern: "*.php" |
| 98 | + path: |
| 99 | + - "src/Services/**" |
| 100 | + contains: |
| 101 | + - "implements ServiceInterface" |
| 102 | + - "@Service" |
| 103 | + notContains: |
| 104 | + - "@deprecated" |
| 105 | + modifiers: |
| 106 | + - trim-php-comments |
| 107 | + showTreeView: true |
| 108 | + |
| 109 | + # Example 5: Self-hosted GitLab with direct server configuration |
| 110 | + - description: Self-hosted GitLab Example |
| 111 | + outputPath: docs/generated/self-hosted-gitlab.md |
| 112 | + sources: |
| 113 | + - type: gitlab |
| 114 | + description: Self-hosted Project |
| 115 | + repository: group/project |
| 116 | + branch: main |
| 117 | + # Direct server configuration instead of referencing a pre-configured server |
| 118 | + server: |
| 119 | + url: https://gitlab.example.com |
| 120 | + token: ${COMPANY_GITLAB_TOKEN} |
| 121 | + headers: |
| 122 | + X-Custom-Header: "custom-value" |
| 123 | + sourcePaths: |
| 124 | + - docs |
| 125 | + filePattern: |
| 126 | + - "*.md" |
| 127 | + - "*.txt" |
| 128 | + showTreeView: true |
0 commit comments