TruCol / Self-host-GitLab-CI-for-GitHub

Installs your own GitLab CI and runs it on all your GitHub repos, in a single command.
GNU Affero General Public License v3.0
4 stars 3 forks source link

Copy complete repo from GitHub to GitLab in 1 single go. #128

Open a-t-0 opened 1 year ago

a-t-0 commented 1 year ago

Currently, this repository evaluates all commits in a GitHub repository and for each commit with a .GitLab-CI.yml, it will:

  1. Clone the repository from GitHub to local
  2. Ddelete the repository if it already exists in the GitLab server
  3. Push the repository to the GitLab server.
  4. Run the CI on that commit and push the build status of that commit result back to GitHub. This is inefficient, because one could also clone the complete repository into GitLab at once, (and wait until all build statusses have been computed in GitLab before pushing the build status results back to GitLab). Look at: run_ci_on_github_repo() { in here.
    • [ ] Find a way to clone the complete repository at once to GitLab (https://github.com/ubc/github2gitlab/issues/1)
    • [ ] Update the code to wait until all build statusses have been computed in GitLab, and push the new build status badges once for the complete cloned repository, back to GitHub.
    • [ ] Allow user to specify an option: "Monitor and push build status batches continuously" in case they want to have a more frequent build status updating after the clone, at the cost of consuming more GitHub push bandwidth.
    • [ ] Do constantly monitor the build statusses in GitLab and automatically push the buildstatus to GitHub if a build is completed. (Ideally with a post-receive script).
    • [ ] Allow the user to specify GitLab starts computing build statusses from most recent commit backwards.
a-t-0 commented 1 year ago

Probably because no https is supported yet.

(base) name@name:~/git$ git clone git@127.0.0.1:root/sponsor_example.git
Cloning into 'sponsor_example'...
kex_exchange_identification: read: Connection reset by peer
Connection reset by 127.0.0.1 port 444
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
(base) name@name:~/git$ git clone git@127.0.0.1:root/sponsor_example.git
Cloning into 'sponsor_example'...
kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port 80
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
(base) name@name:~/git$ git clone git@127.0.0.1:root/sponsor_example.git
Cloning into 'sponsor_example'...
ssh: connect to host 127.0.0.1 port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
a-t-0 commented 1 year ago
touch ~/.ssh/config

and put content:

Host 127.0.0.1
  Hostname 127.0.0.1
  User root
  Port 444
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_ed25519

to make git push for gitlab go over certain port with specific ssh key.

a-t-0 commented 1 year ago

Old command with decayed token:

github2gitlab    --gitlab-url http://127.0.0.1    --gitlab-token sometoken    --github-repo a-t-0/sponsor_example --gitlab-username root