gqmt - Graphql Query Mutation Tool
gqmt [-h] <-u USER -R REPO -T TOKEN -P PACKAGE -t query.tt> REST OF OPTIONS
script to clean up old package versions from GitHub repository
currently it (packages list) is fixed, hardcoded list of packages (may be in future it becomes configurable)
in seconds, default is 2 weeks
user name of repository owner
name of the repository to manipulate images of
path to query template (see TEMPLATES bellow). Template is injected with these variables:
repo : repository name
user : user name
pkg_num : first num element of packages list
pkg_name : package name
vers_num : first num elements from the version files
cursor : pagination object
personal access token to access the GitHub API
GraphQL API endpoint, default is https://api.github.com/graphql
package name to manage versions of
supported packages are:
api
app
scheduler
number of rows for reply pagination, max 100 (default 100)
to use terminal colors in output
if set, then all versions selected are to be deleted, if option -v is set, then the only one single version is to be deleted (the one, set with -v)
process only first page of rows
package version to manipulate with
version information
be verbose
help message
gqmt < -u user-name -R repo-name -P pkg-name -T xxxxxxxxxxxxxxxxxx >
Templates are .tt files. Please refer to Template::Toolkit documentation.
See examples in distribution directory etc
Example of query template:
query { repository(name: "[% repo %]", owner: "[% user %]") { packages(first: [% pkg_num %] names: ["[% pkg_name %]"]) { nodes { id name versions(last: [% vers_num %][% cursor %]) { nodes { id version files(first:1, orderBy: {direction: DESC, field: CREATED_AT}) { totalCount nodes { updatedAt } } } pageInfo { endCursor hasNextPage hasPreviousPage startCursor } } } } } }
https://docs.github.com/en/graphql/guides/forming-calls-with-graphq
Zeus Panchenko <zeus@gnu.org.ua>
Copyright 2020 Zeus Panchenko.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
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/>.
To install App::gqmt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::gqmt
CPAN shell
perl -MCPAN -e shell install App::gqmt
For more information on module installation, please visit the detailed CPAN module installation guide.