Previous
6. Permissions
The repositories
command group allows the user to manage the repositories attached to an analysis. The user can:
The users can define release and push actions that will trigger an update to their analysis repository by leveraging the webhook API of GitHub/GitLab. That way, every time, e.g., a new release happens on a repo, the analysis repo will be updated, enabling the user to have the most up-to-date code saved to the CAP analysis.
Every time the repo is updated, a new snapshot
of the repo will be created, which means that although the most recent version is readily available, older versions are also preserved.
**[terminal]
**[prompt user@pc]**[path ~]**[delimiter $ ]**[command cap-client repositories --help]
Usage: cap-client repositories [OPTIONS] COMMAND [ARGS]...
Manage analysis repositories and webhooks.
Options:
--help Show this message and exit.
Commands:
connect Connect repository with your analysis.
get Get all repositories connected with your analysis.
upload Upload repository tarball to your analysis.
Name | Type | Desc |
---|---|---|
--pid / -p | TEXT | Your analysis PID (Persistent Identifier) [required] |
--with-snapshots / -ws | FLAG | Show snapshots. |
**[terminal]
**[prompt user@pc]**[path ~]**[delimiter $ ]**[command cap-client repositories get --pid <analysis-pid>]
[{
"branch": 'test',
"event_type": "release",
"host": "github.com",
"id": 1,
"name": "test-repo",
"owner": "test-user"
}]
**[terminal]
**[prompt user@pc]**[path ~]**[delimiter $ ]**[command cap-client repositories get --pid <analysis-pid> --with-snapshots]
[{
"branch": 'test',
"event_type": "release",
"host": "github.com",
"id": 1,
"name": "test-repo",
"owner": "test-user",
'snapshots': []
}]
Name | Type | Desc |
---|---|---|
URL | TEXT | The GitHub/GitLab url [required] |
--pid / -p | TEXT | Your analysis PID (Persistent Identifier) [required] |
**[terminal]
**[prompt user@pc]**[path ~]**[delimiter $ ]**[command cap-client repositories upload --pid <analysis-pid> https://github.com/test-user/test-repo]
Repository tarball was saved with your analysis files. (access using `cap-client files` methods)
Name | Type | Desc |
---|---|---|
URL | TEXT | The GitHub/GitLab url [required] |
--pid / -p | TEXT | Your analysis PID (Persistent Identifier) [required] |
--event | TEXT | Download repository tarball on every (push / release) |
**[terminal]
**[prompt user@pc]**[path ~]**[delimiter $ ]**[command cap-client repositories connect --pid <analysis-pid> --event release https://github.com/test-user/test-repo]
Repository was connected with analysis.
Now on every release, we will attach the latest version to your analysis.