This plugin extracts commits and references from a remote or local git repository. It then saves the data into the database or csv files.
refs_commits_diffs table.curl --location --request POST 'localhost:8080/pipelines' \
--header 'Content-Type: application/json' \
--data-raw '
{
"name": "git repo extractor",
"tasks": [
[
{
"Plugin": "gitextractor",
"Options": {
"url": "https://github.com/merico-dev/lake.git",
"repoId": "github:GithubRepo:384111310"
}
}
]
]
}
'
url: the location of the git repository. It should start with http/https for a remote git repository and with / for a local one.repoId: column id of repos. Note : For GitHub, to find the repo id run $("meta[name=octolytics-dimension-repository_id]").getAttribute('content') in browser console.proxy: optional, http proxy, e.g. http://your-proxy-server.com:1080.user: optional, for cloning private repository using HTTP/HTTPSpassword: optional, for cloning private repository using HTTP/HTTPSprivateKey: optional, for SSH cloning, base64 encoded PEM filepassphrase: optional, passphrase for the private keyYou call also run this plugin in a standalone mode without any DevLake service running using the following command:
go run plugins/gitextractor/main.go -url https://github.com/merico-dev/lake.git -id github:GithubRepo:384111310 -db "merico:merico@tcp(127.0.0.1:3306)/lake?charset=utf8mb4&parseTime=True"
For more options (e.g., saving to a csv file instead of a db), please read plugins/gitextractor/main.go.
This plugin depends on libgit2, you need to install version 1.3.0 in order to run and debug this plugin on your local machine. Click here for a brief guide.