mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
Add gitlab support
This commit is contained in:
parent
c0ecdccf41
commit
ac3e8313b3
5 changed files with 65 additions and 8 deletions
|
|
@ -4,6 +4,10 @@
|
||||||
{
|
{
|
||||||
"Type": "github",
|
"Type": "github",
|
||||||
"GitHubUser": "TaqlaAI"
|
"GitHubUser": "TaqlaAI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Type": "gitlab",
|
||||||
|
"GitLabURL": "https://gitlab.com/api/v4/"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -13,6 +13,7 @@ services:
|
||||||
dockerfile: Dockerfile.zoekt-indexserver
|
dockerfile: Dockerfile.zoekt-indexserver
|
||||||
environment:
|
environment:
|
||||||
- GITHUB_TOKEN=${GITHUB_TOKEN}
|
- GITHUB_TOKEN=${GITHUB_TOKEN}
|
||||||
|
- GITLAB_TOKEN=${GITLAB_TOKEN}
|
||||||
- CONFIG_PATH=/app/configs/config.json
|
- CONFIG_PATH=/app/configs/config.json
|
||||||
- ZOEKT_DATA_CACHE_DIR=/zoekt-data/
|
- ZOEKT_DATA_CACHE_DIR=/zoekt-data/
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,12 @@ else
|
||||||
echo -e "\e[33mWarning: Private GitHub repositories will not be indexed since GITHUB_TOKEN was not set. If you are not using GitHub, disregard.\e[0m"
|
echo -e "\e[33mWarning: Private GitHub repositories will not be indexed since GITHUB_TOKEN was not set. If you are not using GitHub, disregard.\e[0m"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if GITLAB_TOKEN is set
|
||||||
|
if [ -n "$GITLAB_TOKEN" ]; then
|
||||||
|
echo "$GITLAB_TOKEN" > "$HOME/.gitlab-token"
|
||||||
|
chmod 600 "$HOME/.gitlab-token"
|
||||||
|
else
|
||||||
|
echo -e "\e[33mWarning: GitLab repositories will not be indexed since GITLAB_TOKEN was not set. If you are not using GitLab, disregard.\e[0m"
|
||||||
|
fi
|
||||||
|
|
||||||
exec "zoekt-indexserver" "-data_dir" "${ZOEKT_DATA_CACHE_DIR}" "-mirror_config" "${CONFIG_PATH}"
|
exec "zoekt-indexserver" "-data_dir" "${ZOEKT_DATA_CACHE_DIR}" "-mirror_config" "${CONFIG_PATH}"
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,23 @@
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"definitions": {
|
"definitions": {
|
||||||
|
"RepoNameRegexIncludeFilter": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Only clone repos whose name matches the given regexp.",
|
||||||
|
"format": "regexp"
|
||||||
|
},
|
||||||
|
"RepoNameRegexExcludeFilter": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Don't mirror repos whose names match this regexp.",
|
||||||
|
"format": "regexp"
|
||||||
|
},
|
||||||
"ZoektConfig": {
|
"ZoektConfig": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/GitHubConfig"
|
"$ref": "#/definitions/GitHubConfig"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/GitLabConfig"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -28,18 +41,15 @@
|
||||||
"description": "The GitHub organization to mirror"
|
"description": "The GitHub organization to mirror"
|
||||||
},
|
},
|
||||||
"Name": {
|
"Name": {
|
||||||
"type": "string",
|
"$ref": "#/definitions/RepoNameRegexIncludeFilter"
|
||||||
"description": "Only clone repos whose name matches the given regexp.",
|
|
||||||
"format": "regexp"
|
|
||||||
},
|
},
|
||||||
"Exclude": {
|
"Exclude": {
|
||||||
"type": "string",
|
"$ref": "#/definitions/RepoNameRegexExcludeFilter"
|
||||||
"description": "Don't mirror repos whose names match this regexp.",
|
|
||||||
"format": "regexp"
|
|
||||||
},
|
},
|
||||||
"CredentialPath": {
|
"CredentialPath": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Path to a file containing a GitHub access token."
|
"description": "Path to a file containing a GitHub access token.",
|
||||||
|
"default": "~/.github-token"
|
||||||
},
|
},
|
||||||
"Topics": {
|
"Topics": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|
@ -70,6 +80,40 @@
|
||||||
"Type"
|
"Type"
|
||||||
],
|
],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"GitLabConfig": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Type": {
|
||||||
|
"const": "gitlab"
|
||||||
|
},
|
||||||
|
"GitLabURL": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The GitLab API url.",
|
||||||
|
"default": "https://gitlab.com/api/v4/"
|
||||||
|
},
|
||||||
|
"Name": {
|
||||||
|
"$ref": "#/definitions/RepoNameRegexIncludeFilter"
|
||||||
|
},
|
||||||
|
"Exclude": {
|
||||||
|
"$ref": "#/definitions/RepoNameRegexExcludeFilter"
|
||||||
|
},
|
||||||
|
"OnlyPublic": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Only mirror public repos",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"CredentialPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to a file containing a GitLab access token.",
|
||||||
|
"default": "~/.gitlab-token"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Type",
|
||||||
|
"GitLabURL"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
||||||
2
vendor/zoekt
vendored
2
vendor/zoekt
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit cab022245653c711f31d1fb0993a7741b11c648a
|
Subproject commit 3780e68cdb537d5a7ed2c84d9b3784f80c7c5d04
|
||||||
Loading…
Reference in a new issue