Git API¶
The Git API provides a set of endpoints for managing Git repositories, branches, and performing various Git operations. It allows users to interact with Git repositories programmatically.
Why Integrate Git with EasyTask?¶
Integrating Git with EasyTask enables you to automate version control and repository management workflows. This integration allows you to:
- Automate Repository Operations: Clone, initialize, and manage Git repositories automatically as part of your EasyTask workflows without manual intervention.
- Streamline Branch and Tag Management: Create branches, switch contexts, create and delete tags, and manage your release workflow programmatically through EasyTask orchestration.
- Automate Commit and Sync Workflows: Stage changes, commit, push, pull, and fetch from remotes automatically, enabling continuous integration and deployment pipelines.
Required Values in Vault¶
Example Usage¶
curl -X POST http://localhost:8008/run-integration \
-H "Content-Type: application/json" \
-d '{
"is_credentials": {
"userid": "test",
"passwd": "test123"
},
"integration": "git",
"uuid": "ae0e8ba9-423a-410e-bba5-e1933ff868c5",
"init": {
"vault_path_key": "git/secret"
},
"action": [
{
"clone": {
"repo_link": "http://192.158.238.91:3000/clouduser3/test.empty.git",
"no_checkout": false,
"reject_shallow": false,
"bare": false
}
}
]
}'
Functions¶
clone¶
clone: This function clones a Git repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_link | str | URL of the repository to clone | yes |
| no_checkout | bool | If true, don't checkout HEAD after cloning | no |
| reject_shallow | bool | If true, reject shallow clones | no |
| bare | bool | If true, create a bare repository | no |
| Output Parameter | Type | Description |
|---|---|---|
| response | str | Confirmation message of successful cloning |
return_working_dir¶
return_working_dir: This function returns the current working directory.
change_working_dir¶
change_working_dir: This function changes the current working directory.
init¶
init: This function initializes a new Git repository.
get_repo_status¶
get_repo_status: This function retrieves the status of the Git repository.
create_branch¶
create_branch: This function creates a new branch in the Git repository.
list_branches¶
list_branches: This function lists all branches in the Git repository.
select_branch¶
select_branch: This function checks out a specified branch.
create_tag¶
create_tag: This function creates a new tag in the Git repository.
delete_tag¶
delete_tag: This function deletes a tag from the Git repository.
stage_changes¶
stage_changes: This function stages all changes in the Git repository.
commit¶
commit: This function commits staged changes to the Git repository.
get_modified_files¶
get_modified_files: This function retrieves a list of modified files in the Git repository.
get_file_version¶
get_file_version: This function retrieves the version of a specific file in the Git repository.
get_commit_count¶
get_commit_count: This function retrieves the total number of commits in the Git repository.
fetch_all¶
fetch_all: This function fetches updates from all remotes.
pull¶
pull: This function pulls changes from a remote repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| repo_name | str | Name of the remote repository | yes |
| branch_name | str | Name of the branch to pull from | yes |
| rebase | bool | If true, rebase instead of merge | no |
| no_commit | bool | If true, don't commit after pull | no |
| verbose | bool | If true, be more verbose | no |
| Output Parameter | Type | Description |
|---|---|---|
| response | str | Confirmation message of pull operation |
get_commit_keys¶
get_commit_keys: This function retrieves commit keys for a specific branch.
get_log¶
get_log: This function retrieves the log for a specific commit.
get_diffs¶
get_diffs: This function retrieves the differences between two commits.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| commit_ID1 | str | ID of the first commit | yes |
| commit_ID2 | str | ID of the second commit | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | str | Differences between the two commits |
push¶
push: This function pushes changes to a remote repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| host_domain | str | Domain of the remote host | yes |
| remote_username | str | Username for the remote repository | yes |
| remote_repo_name | str | Name of the remote repository | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | str | Confirmation message of push operation |
delete_branch_remote¶
delete_branch_remote: This function deletes a branch from a remote repository.
| Input Parameter | Type | Description | Mandatory |
|---|---|---|---|
| host_domain | str | Domain of the remote host | yes |
| remote_username | str | Username for the remote repository | yes |
| remote_repo_name | str | Name of the remote repository | yes |
| branch_name | str | Name of the branch to delete | yes |
| Output Parameter | Type | Description |
|---|---|---|
| response | str | Confirmation message of branch deletion |
Frequently Asked Questions¶
How do I configure Git credentials in EasyTask?¶
Use the EasyTask vault system to securely store your Git authentication token. Navigate to the integration configuration page and add your GitHub auth token under a vault key like git/secret.
Can I use Git with both EasyTask Cloud and On-Premises?¶
Yes, Git works seamlessly with both EasyTask Cloud and On-Premises deployments. The configuration process is identical.
How do I troubleshoot Git connection issues?¶
Check the integration server logs in EasyTask for detailed error messages. Verify your auth token in the vault, ensure the Git server is accessible from the integration server, and test connectivity using the built-in connection test feature.