Giter VIP home page Giter VIP logo

concierge-cli's Introduction

Concierge-cli Latest version on PyPI

GitHub Workflow Status GitHub Workflow Status Code health Python versions Software license

Companion CLI for Concierge, the Configuration management & CI solution for aligning your multitude of Git repositories. Allows you to bulk-manage properties of your Git repository projects. Currently, GitLab is supported.

Why Should I Use This Tool?

Concierge-cli helps you analyze and bulk-update the repository projects you manage (e.g. set topics on projects, generate project lists for ModuleSync).

Installation

From PyPI:

$ pip install concierge-cli

Note: You need Python >= 3.6, otherwise your installation will not succeed (python-gitlab v2.0.0 dropped support for older Pythons). You can use Pipenv to work around this limitation:

$ pip install pipenv
$ pipenv shell --three
$ pip install concierge-cli

Preparation

You need an access token of a GitLab user to access resources through the API. For groups and group membership this needs to be an administrator user. You may also want to disable notifications of the user(s) you plan to perform bulk updates on, to avoid sending out massive amounts of emails.

Set the GitLab URI and TOKEN as environment variables (if you want to avoid using the --token and/or --uri options):

$ export CONCIERGE_GITLAB_URI=https://git.example.com/
$ export CONCIERGE_GITLAB_TOKEN=<redacted>

Usage Patterns

  1. Manage project topics
  2. List projects by topic
  3. List (and merge) merge requests by project
  4. Manage group membership and permissions

Manage topics

List all projects (for a private GitLab) that have no topics yet:

$ concierge-cli gitlab --uri https://git.vs.hn topics --empty

List all projects "foo" or similar in group "bar" or similar: (on GitLab.com)

$ concierge-cli gitlab topics bar/foo --empty

Set topics on all those projects:

$ concierge-cli gitlab topics bar/foo --empty --set-topic Puppet --set-topic Ansible

List all projects with topics now: (double-check)

$ concierge-cli gitlab topics bar/foo

List projects

Print a YAML list of all projects matching a topic:

$ concierge-cli gitlab projects --topic Puppet

Update the list of modules Concierge manages with a specific configuration:

$ concierge-cli gitlab projects --topic Puppet > configs/foo-bar/managed_modules.yml
$ git add -v configs/foo-bar/managed_modules.yml
$ git status && git commit -m 'Added ...' && git push

Merge requests

List of all merge requests of a project, optionally matching labels:

$ concierge-cli gitlab mrs mygroup/myproject --label mylabel

Add --merge yes to trigger merging all found requests.

Group membership

List all groups where user is not yet a member of:

$ concierge-cli gitlab groups --no-member my.user.name

Add user to all those groups:

$ concierge-cli gitlab groups --no-member my.user.name \
                       --set-permission maintainer

List a user's group memberships and permissions:

$ concierge-cli gitlab groups my.user.name

Remove a user from selected groups:

$ concierge-cli gitlab groups my.user.name \
                       --group-filter a-group-name \
                       --set-permission none

Found a bug? Need a new feature?

Please see our Contribution Guide if you want to help out!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.