项目作者: lowzj

项目描述 :
gitlab-ce, gitlab-mirrors and a simple github webhook web server
高级语言: Python
项目地址: git://github.com/lowzj/gitlab-mirror-webhook.git
创建时间: 2016-11-24T11:30:08Z
项目社区:https://github.com/lowzj/gitlab-mirror-webhook

开源协议:Apache License 2.0

下载


gitlab-mirror-webhook

A docker image contains gitlab-ce, gitlab-mirrors and a simple github webhook web server

run docker image gitlab-ce

  1. sh start-gitlab.sh

Clone the gitlab-mirrors repository and set values in config.sh.

  1. sh build-mirror.sh

Modify gitlab-mirror’s config.sh

Modify the values in config.sh for your setup.
Write the private token of the gitmirror GitLab user into ~/private_token of
your gitmirror system user.

  1. system_user="${your_system_user}"
  2. repo_dir="${user_home}/apps/var/gitlab-mirror/repositories"
  3. #This is the Gitlab group where all project mirrors will be grouped.
  4. gitlab_namespace="${your_project_group}"
  5. #This is the base web url of your Gitlab server.
  6. gitlab_url="http://${your_gitlab_url}"
  7. #Special user you created in Gitlab whose only purpose is to update mirror sites and admin the $gitlab_namespace group.
  8. gitlab_user="root"
  9. #Generate a token for your $gitlab_user and set it here.
  10. gitlab_user_token_secret="$(head -n1 "${user_home}/apps/opt/gitlab-mirror/private_token" 2> /dev/null || echo "")"

Add github repo

  1. cd gitlab-mirrors && ./add_mirror.sh --git --project-name YOUR_GITLAB_PROJECT_NAME --mirror YOUR_GITHUB_REPO_URL

Set webhook env

  1. export GITLAB_MIRROR_WEBHOOK_SECRET=xxxx
  2. export GITLAB_MIRROR_WORK_DIR=yyyy

Start webhook.py

  1. sh start-webhook.py