Skip to content

Commit 90bbd7d

Browse files
committed
docs(configuration[generation]) Replace script listings with import redirect
why: The generation page referenced the now-removed gitlab scripts. Redirect readers to `vcspull import` which is the supported approach. what: - Replace generation.md content with stub pointing to {ref}cli-import - Update quickstart.md seealso to reference cli-import instead of config-generation - Remove generation toctree entry from configuration/index.md
1 parent 92c468c commit 90bbd7d

File tree

3 files changed

+9
-112
lines changed

3 files changed

+9
-112
lines changed

docs/configuration/generation.md

Lines changed: 8 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -2,112 +2,16 @@
22

33
# Config generation
44

5-
As a temporary solution for `vcspull` not being able to generate {ref}`configuration` through scanning directories or fetching them via API (e.g. gitlab, github, etc), you can write scripts to generate configs in the mean time.
5+
The `vcspull import` command can generate configuration by fetching
6+
repositories from remote services. See {ref}`cli-import` for details.
67

7-
(config-generation-gitlab)=
8+
Supported services: GitHub, GitLab, Codeberg, Gitea, Forgejo,
9+
AWS CodeCommit.
810

9-
## Collect repos from Gitlab
10-
11-
Contributed by Andreas Schleifer (a.schleifer@bigpoint.net)
12-
13-
Limitation on both, no pagination support in either, so only returns the
14-
first page of repos (as of Feb 26th this is 100).
15-
16-
````{tab} Shell-script
17-
18-
_Requires [jq] and [curl]._
19-
20-
```{literalinclude} ../../scripts/generate_gitlab.sh
21-
:language: shell
22-
```
11+
Example — import all repos from a GitLab group:
2312

2413
```console
25-
$ env GITLAB_TOKEN=mySecretToken \
26-
/path/to/generate_gitlab.sh gitlab.mycompany.com desired_namespace
27-
```
28-
29-
To be executed from the path where the repos should later be stored. It will use
30-
the current working directory as a "prefix" for the path used in the new config file.
31-
32-
Optional: Set config file output path as additional argument (_will overwrite_)
33-
34-
```console
35-
$ env GITLAB_TOKEN=mySecretToken \
36-
/path/to/generate_gitlab.sh gitlab.mycompany.com desired_namespace /path/to/config.yaml
37-
```
38-
39-
**Demonstration**
40-
41-
Assume current directory of _/home/user/workspace/_ and script at _/home/user/workspace/scripts/generate_gitlab.sh_:
42-
43-
```console
44-
$ ./scripts/generate_gitlab.sh gitlab.com vcs-python
45-
```
46-
47-
New file _vcspull.yaml_:
48-
49-
```yaml
50-
/my/workspace/:
51-
g:
52-
url: "git+ssh://git@gitlab.com/vcs-python/g.git"
53-
remotes:
54-
origin: "ssh://git@gitlab.com/vcs-python/g.git"
55-
libvcs:
56-
url: "git+ssh://git@gitlab.com/vcs-python/libvcs.git"
57-
remotes:
58-
origin: "ssh://git@gitlab.com/vcs-python/libvcs.git"
59-
vcspull:
60-
url: "git+ssh://git@gitlab.com/vcs-python/vcspull.git"
61-
remotes:
62-
origin: "ssh://git@gitlab.com/vcs-python/vcspull.git"
14+
$ vcspull import gitlab my-group \
15+
--workspace ~/code \
16+
--mode org
6317
```
64-
65-
[jq]: https://stedolan.github.io/jq/
66-
67-
[curl]: https://curl.se/
68-
69-
````
70-
71-
````{tab} Python
72-
_Requires [requests] and [pyyaml]._
73-
74-
This confirms file overwrite, if already exists. It also requires passing the protocol/schema
75-
of the gitlab mirror, e.g. `https://gitlab.com` instead of `gitlab.com`.
76-
77-
```{literalinclude} ../../scripts/generate_gitlab.py
78-
:language: python
79-
```
80-
81-
**Demonstration**
82-
83-
Assume current directory of _/home/user/workspace/_ and script at _/home/user/workspace/scripts/generate_gitlab.sh_:
84-
85-
```console
86-
$ ./scripts/generate_gitlab.py https://gitlab.com vcs-python
87-
```
88-
89-
```yaml
90-
/my/workspace/vcs-python:
91-
g:
92-
remotes:
93-
origin: ssh://git@gitlab.com/vcs-python/g.git
94-
url: git+ssh://git@gitlab.com/vcs-python/g.git
95-
libvcs:
96-
remotes:
97-
origin: ssh://git@gitlab.com/vcs-python/libvcs.git
98-
url: git+ssh://git@gitlab.com/vcs-python/libvcs.git
99-
vcspull:
100-
remotes:
101-
origin: ssh://git@gitlab.com/vcs-python/vcspull.git
102-
url: git+ssh://git@gitlab.com/vcs-python/vcspull.git
103-
```
104-
105-
[requests]: https://docs.python-requests.org/en/latest/
106-
[pyyaml]: https://pyyaml.org/
107-
108-
````
109-
110-
### Contribute your own
111-
112-
Post yours on <https://github.com/vcs-python/vcspull/discussions> or create a PR to add
113-
yours to scripts/ and be featured here

docs/configuration/index.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ YAML:
8888
8989
````
9090

91-
```{toctree}
92-
:maxdepth: 2
93-
:hidden:
94-
95-
generation
96-
```
97-
9891
## Caveats
9992

10093
(git-remote-ssh-git)=

docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ via trunk (can break easily):
102102
## Configuration
103103

104104
```{seealso}
105-
{ref}`configuration` and {ref}`config-generation`.
105+
{ref}`configuration` and {ref}`cli-import`.
106106
```
107107

108108
We will check out the source code of [flask][flask] to `~/code/flask`.

0 commit comments

Comments
 (0)