Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add script to generate config based on a gitlab group #336

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

aschleifer
Copy link
Contributor

As discussed in #334 this is a first version of a shell script to add a generator script.

It relies on the binaries curl and jq to be present.

Most likely there will be a future version of this written in python.

@CLAassistant
Copy link

CLAassistant commented Feb 23, 2022

CLA assistant check
All committers have signed the CLA.

@tony tony merged commit 4c7909c into vcs-python:master Feb 23, 2022
@tony
Copy link
Member

tony commented Feb 23, 2022

@aschleifer Thank you!

Are you okay with me adding this to the examples page? https://vcspull.git-pull.com/examples.html

If so, how to you prefer to be credited? (e.g. name, email, link, etc)

P.S. Do you have an example invocation? e.g. what it'd look like to run the command in bash?

@aschleifer
Copy link
Contributor Author

I'm fine with it being added to the example page. For credit just mention the Name and/or reference my github account.

exmaple invocation:

export GITLAB_TOKEN=mySecretToken
/path/to/generate_gitlab.sh gitlab.mycompany.com desired_namespace

This has to be executed in the path where the repos should later be stored, as it takes the current working directory as "prefix" for the path in the config file.

Optionally you can pass a path to the config file as additional argument /path/to/generate_gitlab.sh gitlab.mycompany.com desired_namespace /path/to/config.yaml which will then be overwritten with the result.

@aschleifer aschleifer deleted the 334_generate_gitlab_script branch February 24, 2022 10:46
@aschleifer
Copy link
Contributor Author

@tony one limitation I just remember: The gitlab API is doing pagination for large outputs and in this case the maximum amount of entries per page is 100.

I didn't implement any logic to read subsequent pages, so if someone uses this on a namespace with more then 100 repos under it then it will only return 100 of them.

@tony
Copy link
Member

tony commented Feb 26, 2022

@aschleifer This script is online here: https://vcspull.git-pull.com/config-generation.html#shell-script-version

Tested locally, works great (I included my result in demonstration)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants