This directory contains scripts that query a source code manager (SCM) to create a CSV file that contains a list of repositories and their details. This list of repositories can then be used for easy cloning with the Moderne CLI or it can be used to help you create an Organizations service.
The expected output looks similar to:
cloneUrl,branch
https://github.com/openrewrite/rewrite-spring,main
https://github.com/openrewrite/rewrite-recipe-markdown-generator,main
https://github.com/openrewrite/rewrite-docs,master
https://github.com/openrewrite/rewrite,main
https://github.com/openrewrite/rewrite-python,main
https://github.com/openrewrite/rewrite-migrate-java,main
https://github.com/openrewrite/rewrite-recommendations,main
https://github.com/openrewrite/rewrite-testing-frameworks,main
https://github.com/openrewrite/rewrite-gradle-tooling-model,main
https://github.com/openrewrite/rewrite-recipe-bom,main
Below are the details of each script along with examples of how to invoke them and their required/optional arguments.
This script fetches all repositories from a GitHub organization.
./github.sh <organization_name>
This script fetches all repositories from the specified GitHub organization.
- You must also have the GitHub CLI installed.
- You must either have run
gh auth login
or set theGITHUB_TOKEN
environment variable for authentication.
(Note: if you use a GitHub installation rather than github.com
you will have to gh auth login --hostname github.mycompany.com
)
To fetch all repositories from a GitHub organization:
./github.sh my-organization
This script fetches all repositories from a Bitbucket Data Center instance.
./bitbucket-data-center.sh <bitbucket_url>
This script fetches all repositories from the specified Bitbucket Data Center URL. If the AUTH_TOKEN
environment variable is set, it will be used for authentication.
To fetch all repositories from a Bitbucket Data Center instance:
AUTH_TOKEN=YOUR_TOKEN ./bitbucket-data-center.sh https://my-bitbucket.com/stash
This script fetches all repositories from a Bitbucket Data Center instance.
./bitbucket-cloud.sh -u username -p password <workspace>
This script fetches all repositories from the specified Bitbucket Data Center URL. If the AUTH_TOKEN
environment variable is set, it will be used for authentication.
To fetch all repositories from a Bitbucket Data Center instance:
./bitbucket-cloud.sh -u YOUR_USERNAME -p APP_PASSWORD myworkspace
This script fetches all repositories from a GitLab instance or a specific group within a GitLab instance.
./gitlab.sh [-g <group>] [-h <gitlab_domain>]
This script fetches all repositories from a GitLab instance or a specific group within a GitLab instance. The AUTH_TOKEN
environment variable must be set for authentication. The -g
option specifies a group to fetch repositories from. The -h
option specifies the GitLab domain (defaults to https://gitlab.com
if not provided).
To fetch all repositories from a specific group on a custom GitLab domain:
AUTH_TOKEN=YOUR_TOKEN ./gitlab.sh -g my-group -h https://my-gitlab.com