Skip to content

wuub/gitlab-mirror-post-fetch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitlab-mirror-post-fetch

Post fetch app compatible with https://github.com/dustin/gitmirror

Deploy to Heroku

  1. Create GitLab user (eg. GitMirror).
  2. Create GitLab group (eg. Mirrors) and give GitLab user owner permissions.
  3. Find GitLab user private token: https://my.gitlab.instance.com/profile/account
  4. Create SSH private key and add it's public part to your GitLab
  5. Deploy
  6. And fill the forms:
    • GITLAB_PRIVATE_TOKEN: Private token
    • GITLAB_URL: Address of your GitLab instance
    • GITLAB_GROUP: Where all mirrors should be created
    • GITLAB_SSH_KEY: Paste here SSH private key
    • GITMIRROR_SECRET: Generate unique password that will secure your GitMirror installation
  7. Click Deploy For Free
  8. Open GitHub on project that you want to mirror. Go to Settings -> Webhooks & Services -> Add Webhook:
  9. Within a couple of seconds mirror should be created and should be run in sync.
  10. In case of error you can check Recent Deliveries and Response.

Deploy to Tutum

  1. Create GitLab user (eg. GitMirror).
  2. Create GitLab group (eg. Mirrors) and give GitLab user owner permissions.
  3. Find GitLab user private token: https://my.gitlab.instance.com/profile/account
  4. Create SSH private key and add it's public part to your GitLab
  5. Deploy to Tutum
  6. Click Create and Deploy
  7. Go to service settings and edit environment variables:
    • GITLAB_PRIVATE_TOKEN: Private token
    • GITLAB_URL: Address of your GitLab instance
    • GITLAB_GROUP: Where all mirrors should be created
    • GITLAB_SSH_KEY: Paste here SSH private key
    • GITMIRROR_SECRET: Generate unique password that will secure your GitMirror installation
  8. Open GitHub on project that you want to mirror. Go to Settings -> Webhooks & Services -> Add Webhook:
    • Payload URL: Paste URL of your application and add: /callback/github, ie.: http://tutum-ip-address/callback/github
    • Secret: Enter your unique password, the same as GITMIRROR_SECRET.
    • Select Just the push event.
    • Add Webhook.
  9. Within a couple of seconds mirror should be created and should be run in sync.
  10. In case of error you can check Recent Deliveries and Response.

Advanced Installation

go get github.com/ayufan/gitlab-mirror-post-fetch

The Use

  1. Create GitLab user (eg. GitMirror).
  2. Create GitLab group (eg. Mirrors) and give GitLab user owner permissions.
  3. Find GitLab user private token: https://my.gitlab.instance.com/profile/account
  4. Install https://github.com/dustin/gitmirror
  5. Create bin/post-fetch script filling in the blanks:
#!/bin/bash

export GITLAB_PRIVATE_TOKEN=MY_GITMIRROR_USER_PRIVATE_TOKEN
export GITLAB_URL=https://my.gitlab.instance.com/
export GITLAB_GROUP=Mirrors

exec gitlab-mirror-post-fetch
  1. Give bin/post-fetch executable permissions: chmod +x bin/post-fetch
  2. Configure gitmirror script as described. Giving it or not secret.

Author

Kamil Trzciński, Polidea, 2014-2015

License

MIT

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.7%
  • Shell 5.3%