-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
Hey @tony ,
how willing would you be to include some contribution scripts in the repository to help generate an initial config file?
I use vcspull to manage ~70 repos in my work place all under one gitlab group. I wrote a small shell script to scan this group and generate an initial config file out of it.
Initially I thought to just share this internally in my company, but if you are willing we could add this to the repository (after i made it a bit more abstract).
Please let me know your thoughts about this.
Best regards
Segaja
rogerioefonseca
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
tony commentedon Feb 22, 2022
@aschleifer Yes, happily
In the long run I am considering a
vcspull scan
type feature (#25). If such a thing were to exist, it may deprecate such a script.Assuming there was a
vcspull scan
, is there any behavior / functionality you'd find fit your / all needs?aschleifer commentedon Feb 22, 2022
I think
vcspull scan
would be a nice addition, but it only helps if you already have a bunch of repos checked out in a given folder structure. My script would talk to a gitlab instance and give you a list of all the repos under one group and write a config out of that.I think both cases are valid but not eliminating each other.
On the current topic: I will make my script more generic and create a pull request.
tony commentedon Feb 22, 2022
This seems clever.
It may make sense for future command/plugin for a bitbucket/github/gitlab api wrapper to pull a list of repos.
Sounds good.
If it can work with pure standard library (without requiring an additional dependency), even better. But if that makes it prohibitively difficult, feel free to use whatever packages work.
aschleifer commentedon Feb 23, 2022
Right now my script is a basic shell script using
curl
andjq
. If you want I could paste it here and maybe it can be converted to python and integrated into vcspull directly. For a first step I think it would already help to provide it as bash scripttony commentedon Feb 23, 2022
@aschleifer I think pasting it here would be a good next step, good ahead!
aschleifer commentedon Feb 23, 2022
That is the version I have right now. The first 3 variables have to be given at runtime together with the
GITLAB_TOKEN
.Once #332 gets resolved the 4
echo
lines in thewhile
loop could be replaced by the commented out one liner.tony commentedon Feb 23, 2022
@aschleifer How about you create a PR with this script in the
scripts/
directory? Then we / I can include it in thedocs/
. We can also uncomment the simplified config when #332 is fixed.I was going to suggest
contrib/
but think that may fit python modules better (e.g.vcspull.contrib
)Another possibility, if you had time, it to write the above script in vanilla python 3 w/ standard library. That would actually the best
aschleifer commentedon Feb 23, 2022
@tony I can easily provide this in a
scripts/
folder via PR. I will also go ahead and add make the needed variables required on execution.I haven't written python code in a while so it might take some time but could be fun to do it, but I think the first version is fine to be a shell script.
tony commentedon Feb 23, 2022
Segaja commentedon Feb 27, 2022
Thanks for adding the scripts to the documentation ( https://vcspull.git-pull.com/config-generation.html ).
If desired I can try to update the shell script to remove some of the differences between the two scripts from a usage point of view.
Also, once the new command-file structure ( discussed in #333 ) is in place I might spend the time and reworking all this into a "native" vcspull command and then the two scripts get obsolete.
tony commentedon Feb 27, 2022
Yes you are welcome to
That is coming next - i am guessing the next 2 weeks or so. The reason why I don't have a concrete date is I'm reading the codebase from scratch and would approach things differently now - some areas are so opaque it'd turn off people from contributed