Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68f0111c2b | ||
|
|
45087d9de2 | ||
|
|
b622724eb7 | ||
|
|
b5a31b2c6b | ||
|
|
3f11082d3e |
@@ -16,3 +16,11 @@ docker build -t cerc/act-runner:local .
|
|||||||
1. Bring up the gitea cluster `docker compose up -d`
|
1. Bring up the gitea cluster `docker compose up -d`
|
||||||
1. Run the script `./initialize-gitea.sh`
|
1. Run the script `./initialize-gitea.sh`
|
||||||
1. Note the access token printed, it will be needed to publish packages.
|
1. Note the access token printed, it will be needed to publish packages.
|
||||||
|
|
||||||
|
#### Debugging
|
||||||
|
Gitea server logs can be seen via docker logs <container-id>.
|
||||||
|
To enable more verbose log output add an environment variable definition like:
|
||||||
|
```
|
||||||
|
GITEA__log__LEVEL=TRACE
|
||||||
|
```
|
||||||
|
to the `server` definition in `docker-compose.yml` and re-start.
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ cache:
|
|||||||
port: 0
|
port: 0
|
||||||
|
|
||||||
container:
|
container:
|
||||||
# Which network to use for the job containers. Could be bridge, host, none, or the name of a custom network.
|
|
||||||
network_mode: bridge
|
|
||||||
# Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker).
|
# Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker).
|
||||||
privileged: true
|
privileged: true
|
||||||
# And other options to be used when the container is started (eg, --add-host=my.gitea.url:host-gateway).
|
# And other options to be used when the container is started (eg, --add-host=my.gitea.url:host-gateway).
|
||||||
|
|||||||
Executable
+54
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ORG=$1
|
||||||
|
|
||||||
|
#USERNAME=$1
|
||||||
|
USER_API_URL="https://api.github.com/users/$USERNAME/repos"
|
||||||
|
|
||||||
|
API_URL="https://api.github.com/orgs/$ORG/repos"
|
||||||
|
PAGE=1
|
||||||
|
|
||||||
|
# appears uncoupled from limit of 100 repos
|
||||||
|
PER_PAGE=100
|
||||||
|
|
||||||
|
# Function to retrieve repositories for a given page
|
||||||
|
get_repos() {
|
||||||
|
local page=$1
|
||||||
|
curl -s "$USER_API_URL?page=$page&per_page=$PER_PAGE"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Query GitHub API for the first page of repositories
|
||||||
|
response=$(get_repos $PAGE)
|
||||||
|
|
||||||
|
# Check if organization exists
|
||||||
|
if [[ $response =~ "Not Found" ]]; then
|
||||||
|
echo "Organization not found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get total number of repositories
|
||||||
|
total_repos=$(echo "$response" | grep -oE '"full_name": "[^"]+"' | wc -l)
|
||||||
|
|
||||||
|
# Initialize array for repositories
|
||||||
|
repos=()
|
||||||
|
|
||||||
|
# Parse repository names and add to the array
|
||||||
|
repos+=($(echo "$response" | grep -oE '"full_name": "[^"]+"' | awk -F': "' '{print $2}' | tr -d '"'))
|
||||||
|
|
||||||
|
# Calculate number of pages needed
|
||||||
|
num_pages=$((($total_repos + $PER_PAGE - 1) / $PER_PAGE))
|
||||||
|
|
||||||
|
# Loop through the remaining pages and retrieve repositories
|
||||||
|
for ((page=2; page<=num_pages; page++)); do
|
||||||
|
response=$(get_repos $page)
|
||||||
|
repos+=($(echo "$response" | grep -oE '"full_name": "[^"]+"' | awk -F': "' '{print $2}' | tr -d '"'))
|
||||||
|
done
|
||||||
|
|
||||||
|
# Loop through the array and output each repository
|
||||||
|
for repo in "${repos[@]}"; do
|
||||||
|
echo "$repo"
|
||||||
|
bash migrate-repo.sh $repo
|
||||||
|
done
|
||||||
|
|
||||||
|
# Display count of repositories
|
||||||
|
echo "Total Repositories: $total_repos"
|
||||||
Reference in New Issue
Block a user