SALSA.DE(1) | SALSA.DE(1) |
salsa - tool to manipulate salsa projects, repositories and group members
# salsa <command> <parameters> <options> salsa add_user developer foobar --group-id 2665 salsa delete_user foobar --group js-team salsa search_groups perl-team/modules salsa search_projects qa/qa salsa search_users yadd salsa update_user maintainer foobar --group js-team salsa whoami salsa checkout node-mongodb --group js-team salsa fork salsa fork --group js-team user/node-foo salsa last_ci_status js-team/nodejs salsa pipelines js-team/nodejs salsa mr debian/foo debian/master salsa push_repo . --group js-team --kgb --irc devscripts --tagpending salsa update_projects node-mongodb --group js-team --disable-kgb --desc \ --desc-pattern "Package %p" salsa update_safe --all --desc --desc-pattern "Debian package %p" \ --group js-team
salsa is designed to create and configure projects and repositories on <https://salsa.debian.org> as well as to manage group members.
A Salsa token is required, except for search* commands, and must be set in command line (see below), or in your configuration file (~/.devscripts):
SALSA_TOKEN=abcdefghi
or
SALSA_TOKEN=`cat ~/.token`
or
SALSA_TOKEN_FILE=~/.dpt.conf
If you choose to link another file using SALSA_TOKEN_FILE, it must contain a line with one of (no differences):
<anything>SALSA_PRIVATE_TOKEN=xxxx <anything>SALSA_TOKEN=xxxx
This allows for example to use dpt(1) configuration file (~/.dpt.conf) which contains:
DPT_SALSA_PRIVATE_TOKEN=abcdefghi
salsa --group js-group add_user guest foouser salsa --group-id 1234 add_user guest foouser salsa --group-id 1234 add_user maintainer 1245
First argument is the GitLab's access levels: guest, reporter, developer, maintainer, owner.
salsa --group js-team delete_user foouser salsa --group-id=1234 delete_user foouser
salsa join js-team salsa join --group js-team salsa join --group-id 1234
salsa --group js-team list_users salsa --group-id 1234 list_users
salsa search_groups perl-team salsa search_groups perl-team/modules salsa search_groups 2666
salsa search_users yadd
salsa --group-id 1234 update_user guest foouser salsa --group js-team update_user maintainer 1245
First argument is the GitLab's access levels: guest, reporter, developer, maintainer, owner.
salsa whoami
One of "--group", "--group-id", "--user" or "--user-id" is required to manage projects. If both are set, salsa warns and only "--user"/"--user-id" is used. If none is given, salsa uses current user ID (token owner).
salsa --user yadd --tagpending --kgb --irc=devscripts check_projects test salsa --group js-team check_projects --all salsa --group js-team --rename-head check_projects test1 test2 test3
salsa --user yadd checkout devscripts salsa --group js-team checkout node-mongodb salsa checkout js-team/node-mongodb
You can clone more than one repository or all repositories of a group or a user:
salsa --user yadd checkout devscripts autodep8 salsa checkout yadd/devscripts js-team/npm salsa --group js-team checkout --all # All js-team active repositories salsa checkout --all-archived # All your repositories, including archived
salsa --user yadd create_project test salsa --group js-team --kgb --irc-channel=devscripts create_project test
$ salsa fork js-team/node-mongodb --verbose ... salsa.pl info: node-mongodb ready in node-mongodb/ $ cd node-mongodb $ git remote --verbose show origin git@salsa.debian.org:me/node-mongodb (fetch) origin git@salsa.debian.org:me/node-mongodb (push) upstream git@salsa.debian.org:js-team/node-mongodb (fetch) upstream git@salsa.debian.org:js-team/node-mongodb (push)
For a group:
salsa fork --group js-team user/node-foo
salsa forks qa/qa debian/devscripts
Project can be set using full path or using --group/--group-id or --user/--user-id, else it is searched in current user namespace.
salsa push
It pushes the following refs to the configured remote for the debian-branch or, falling back, to the "origin" remote:
salsa --group js-team list_projects salsa --user yadd list_projects foo*
salsa --group js-team last_ci_status --all --no-fail salsa --user yadd last_ci_status foo salsa last_ci_status js-team/nodejs
This commands returns the number of "failed" status found. "success" entries are displayed using STDOUT while other are displayed (with details) using STDERR. Then you can easily see only failures using:
salsa --group js-team last_ci_status --all --no-fail >/dev/null
You can use --no-fail and --all options here.
Suppose you created a fork using salsa fork, modify some things in a new branch using one commit and want to propose it to original project (branch "master"). You just have to launch this in source directory:
salsa merge_request
Another example:
salsa merge_request --mr-dst-project debian/foo --mr-dst-branch debian/master
Or simply:
salsa merge_request debian/foo debian/master
Note that unless destination project has been set using command line, salsa merge_request will search it in the following order:
To force salsa to use source project as destination project, you can use "same":
salsa merge_request --mr-dst-project same # or salsa merge_request same
New merge request will be created using last commit title and description.
See --mr-* options for more.
salsa merge_requests qa/qa debian/devscripts
Project can be set using full path or using --group/--group-id or --user/--user-id, else it is searched in current user namespace.
# project branch merge push salsa --group js-team protect_branch node-mongodb master m d
"merge" and "push" can be one of:
salsa --group js-team protect_branch node-mongodb master no
salsa --group js-team protected_branches node-mongodb
push_repo executes the following steps:
Beispiele:
salsa --user yadd push_repo ./test salsa --group js-team --kgb --irc-channel=devscripts push_repo .
salsa search_projects devscripts salsa search_projects debian/devscripts salsa search_projects 18475
salsa --user yadd --tagpending --kgb --irc=devscripts update_projects test salsa --group js-team update_projects --all salsa --group js-team --rename-head update_projects test1 test2 test3 salsa update_projects js-team/node-mongodb --kgb --irc debian-js
By default when using --all, salsa will fail on first error. If you want to continue, set --no-fail. In this case, salsa will display a warning for each project that has fail but continue with next project. Then to see full errors, set --verbose.
salsa --user yadd --tagpending --kgb --irc=devscripts update_safe test salsa --group js-team update_safe --all salsa --group js-team --rename-head update_safe test1 test2 test3 salsa update_safe js-team/node-mongodb --kgb --irc debian-js
salsa --chdir ~/debian checkout debian/libapache2-mod-fcgid
".devscripts" value: SALSA_CACHE_FILE
If you want to use a subgroup, you have to set its full path:
salsa --group perl-team/modules/packages check_projects lemonldap-ng
".devscripts" value: SALSA_GROUP
Be careful when you use SALSA_GROUP in your ".devscripts" file. Every salsa command will be executed in group space, for example if you want to propose a little change in a project using salsa fork + salsa merge_request, this "fork" will be done in group space unless you set a --user/--user-id. Prefer to use an alias in your ".bashrc" file. Example:
alias jsteam_admin="salsa --group js-team"
or
alias jsteam_admin="salsa --conf-file ~/.js.conf
or to use both .devscripts and .js.conf:
alias jsteam_admin="salsa --conf-file +~/.js.conf
then you can fix SALSA_GROUP in "~/.js.conf"
To enable bash completion for your alias, add this in your .bashrc file:
_completion_loader salsa complete -F _salsa_completion jsteam_admin
".devscripts" value: SALSA_GROUP_ID
Be careful when you use SALSA_GROUP_ID in your ".devscripts" file. Every salsa command will be executed in group space, for example if you want to propose a little change in a project using salsa fork + salsa merge_request, this "fork" will be done in group space unless you set a --user/--user-id. Prefer to use an alias in your ".bashrc" file. Example:
alias jsteam_admin="salsa --group-id 2666"
or
alias jsteam_admin="salsa --conf-file ~/.js.conf
then you can fix SALSA_GROUP_ID in "~/.js.conf".
".devscripts" value: SALSA_INFO (yes/no)
".devscripts" value: SALSA_REPO_PATH
".devscripts" value: SALSA_USER_ID
".devscripts" value: SALSA_YES (yes/no)
".devscripts" value: SALSA_ARCHIVED (yes/no)
salsa update_projects --tagpending --all --skip qa --skip devscripts
To set multiples values, use spaces. Example:
SALSA_SKIP=qa devscripts
Using --no-skip will ignore any projects to be skipped and include them.
".devscripts" value: SALSA_SKIP
salsa update_projects --tagpending --all --skip-file ~/.skip
".devscripts" value: SALSA_SKIP_FILE
salsa update_safe myrepo --build-timeout 3600
".devscripts" value: SALSA_BUILD_TIMEOUT
".devscripts" value: SALSA_AVATAR_PATH
salsa update_safe --ci-config-path recipes/debian.yml@salsa-ci-team/pipeline debian/devscripts
".devscripts" value: SALSA_CI_CONFIG_PATH
".devscripts" value: SALSA_DESC (yes/no)
".devscripts" value: SALSA_DESC_PATTERN
".devscripts" value: SALSA_EMAIL (yes/ignore/no, default: ignore)
$ salsa update_safe myrepo \ --email-recipient foo@foobar.org \ --email-recipient bar@foobar.org
If recipient value contains "%p", it is replaced by project name.
".devscripts" value: SALSA_EMAIL_RECIPIENTS (use spaces to separate multiples recipients)
".devscripts" value: SALSA_ENABLE_ANALYTICS (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_AUTO_DEVOPS (yes/no, default: yes)
".devscripts" value: SALSA_ENABLE_CONTAINER (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_ENVIRONMENTS (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_FEATURE_FLAGS (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_FORKS (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_INFRASTRUCTURE (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_ISSUES (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_JOBS (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_LFS (yes/no, default: yes)
".devscripts" value: SALSA_ENABLE_MR (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_MONITOR (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_PACKAGES (yes/no, default: yes)
".devscripts" value: SALSA_ENABLE_PAGES (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_RELEASES (yes/private/no, default: yes)
".devscripts" value: SALSA_REMOVE_SOURCE_BRANCH (yes/no, default: yes)
".devscripts" value: SALSA_ENABLE_REPO (yes/private/no, default: yes)
".devscripts" value: SALSA_REQUEST_ACCESS (yes/no)
".devscripts" value: SALSA_ENABLE_REQUIREMENTS (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_SECURITY_COMPLIANCE (yes/no)
".devscripts" value: SALSA_ENABLE_SERVICE_DESK (yes/no)
".devscripts" value: SALSA_ENABLE_SNIPPETS (yes/private/no, default: yes)
".devscripts" value: SALSA_ENABLE_WIKI (yes/private/no, default: yes)
Important: channel must not include the first "#". If salsa finds a channel starting with "#", it will consider that the channel starts with 2 "#"!
".devscript" value: SALSA_IRC_CHANNEL
Multiple values must be space separated.
Since configuration files are read using sh, be careful when using "#": you must enclose the channel with quotes, else sh will consider it as a comment and will ignore this value.
".devscripts" value: SALSA_IRKER (yes/ignore/no, default: ignore)
".devscripts" value: SALSA_IRKER_HOST
".devscripts" value: SALSA_IRKER_PORT
".devscripts" value: SALSA_KGB (yes/ignore/no, default: ignore)
$ salsa update_safe debian/devscripts --kgb --irc-channel devscripts \ --kgb-options 'merge_requests_events,issues_events,enable_ssl_verification'
List of available options: confidential_comments_events, confidential_issues_events, confidential_note_events, enable_ssl_verification, issues_events, job_events, merge_requests_events, note_events, pipeline_events, tag_push_events, wiki_page_events
".devscripts" value: SALSA_KGB_OPTIONS
".devscripts" value: SALSA_NO_FAIL (yes/no, default: no)
".devscripts" value: SALSA_RENAME_HEAD (yes/no)
".devscripts" value: SALSA_SOURCE_BRANCH
".devscripts" value: SALSA_DEST_BRANCH
".devscripts" value: SALSA_TAGPENDING (yes/ignore/no, default: ignore)
0 1 * * *.
If --mr-dst-project is set to same, salsa will use source project as destination.
".devscripts" value: SALSA_MR_ALLOW_SQUASH (yes/no)
".devscripts" value: SALSA_MR_REMOVE_SOURCE_BRANCH (yes/no)
".devscripts" value: SALSA_API_URL
".devscripts" value: SALSA_GIT_SERVER_URL
".devscripts" value: SALSA_IRKER_SERVER_URL
".devscripts" value: SALSA_KGB_SERVER_URL
".devscripts" value: SALSA_TAGPENDING_SERVER_URL
Configuration file example
Example to use salsa with <https://gitlab.ow2.org> (group "lemonldap-ng"):
SALSA_TOKEN=`cat ~/.ow2-gitlab-token` SALSA_API_URL=https://gitlab.ow2.org/api/v4 SALSA_GIT_SERVER_URL=git@gitlab.ow2.org: SALSA_GROUP_ID=34
Then to use it, add something like this in your ".bashrc" file:
alias llng_admin='salsa --conffile ~/.salsa-ow2.conf'
dpt-salsa
Xavier Guimard <yadd@debian.org>
Copyright (C) 2018, Xavier Guimard <yadd@debian.org>
It contains code formerly found in dpt-salsa (pkg-perl-tools) copyright 2018, gregor herrmann <gregoa@debian.org>.
Dieses Programm ist freie Software; Sie können es unter den Bedingungen der GNU General Public License, Version 2 oder (nach Ihrer Wahl) neuer, wie sie von der Free Software Foundation veröffentlicht wurde, weitergeben und/oder ändern.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
2023-12-12 | Debian-Hilfswerkzeuge |