added docker compose support and readme
This commit is contained in:
parent
866ce41945
commit
68d3c4447b
|
|
@ -0,0 +1,5 @@
|
|||
LOCAL_GIT_ACCESS_TOKEN=your_access_token
|
||||
LOCAL_GIT_URL=your_git_url
|
||||
GIT_USER=your_git_user
|
||||
TARGET_ORG=your_target_org
|
||||
MODE=your_mode
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# Mirror your starred Github repos to a Gitea organization
|
||||
|
||||
### Inspiration for this script:
|
||||
|
||||
[Proposal: Mirror an entire github organization into gitea organization](https://github.com/go-gitea/gitea/issues/8424)
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
The script runs forever, every 12 hours it executes API calls to retrieve either your starred or public repositories and mirrors them to your local gitea( or forks from this project) server.
|
||||
|
||||
Feel free to change it to a one time only script and calling it in a cronjob.
|
||||
|
||||
### Docker Compose
|
||||
|
||||
edit ```.env``` the way you need it
|
||||
|
||||
docker-compose up --build
|
||||
|
||||
### Bash
|
||||
|
||||
export LOCAL_GIT_ACCESS_TOKEN="your_access_token"
|
||||
export LOCAL_GIT_URL="your_git_url"
|
||||
export GIT_USER="your_git_user"
|
||||
export TARGET_ORG="your_target_org"
|
||||
export MODE="your_mode"
|
||||
|
||||
bash github-git-mirror.sh "${GIT_USER}" "${TARGET_ORG}" "${MODE}"
|
||||
26
README.org
26
README.org
|
|
@ -1,26 +0,0 @@
|
|||
#+title: Mirror your starred Github repos to a Gitea organization
|
||||
|
||||
* Inspiration for this script
|
||||
|
||||
[[https://github.com/go-gitea/gitea/issues/8424][Proposal: Mirror an entire github organization into gitea organization]]
|
||||
|
||||
I wanted to mirror my starred repos instead. Mirroring an organization is on the [[*TODOs][TODOs]] list.
|
||||
|
||||
* Usage
|
||||
|
||||
Using [[https://github.com/][GitHub]] user =juergenhoetzel= and Gitea organization =githubmirror=
|
||||
|
||||
#+BEGIN_SRC bash
|
||||
export ACCESS_TOKEN=3a765a661619136db92aa267d90c457573x98812
|
||||
export LOCAL_GIT_URL=http://gitea.fritz.box:3000
|
||||
github2gitea-mirror juergenhoetzel githubmirror
|
||||
#+END_SRC
|
||||
|
||||
|
||||
* TODOs
|
||||
- [ ] Mirror github organization
|
||||
- [ ] Mirror private repos
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
version: '3.8'
|
||||
services:
|
||||
git-mirror:
|
||||
build: .
|
||||
env_file:
|
||||
- .env
|
||||
restart: unless-stopped
|
||||
|
|
@ -56,5 +56,10 @@ repos_to_migration() {
|
|||
done
|
||||
}
|
||||
|
||||
fetch_starred_repos
|
||||
repos_to_migration
|
||||
main(){
|
||||
fetch_starred_repos
|
||||
repos_to_migration
|
||||
sleep 43100
|
||||
|
||||
}
|
||||
while :; do main; done
|
||||
|
|
|
|||
Loading…
Reference in New Issue