Suche senden
Hochladen
Add mailinglist command to gitolite
•
0 gefällt mir
•
1,322 views
琛
琛琳 饶
Folgen
How does gitolite works? How to add mailinglist command to gitolite?
Weniger lesen
Mehr lesen
Melden
Teilen
Melden
Teilen
1 von 13
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Git 使用介绍
Git 使用介绍
medcl
Submodule && subtree
Submodule && subtree
哲 于
Learn git
Learn git
甘 李
Git 版本控制 (使用教學)
Git 版本控制 (使用教學)
Jui An Huang (黃瑞安)
Gitlab
Gitlab
Tom Chen
Git and Github basic with SourceTree
Git and Github basic with SourceTree
Chu-Siang Lai
Visual Studio 2015 與 Git 開發實戰
Visual Studio 2015 與 Git 開發實戰
Will Huang
Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)
Cloud Tu
Empfohlen
Git 使用介绍
Git 使用介绍
medcl
Submodule && subtree
Submodule && subtree
哲 于
Learn git
Learn git
甘 李
Git 版本控制 (使用教學)
Git 版本控制 (使用教學)
Jui An Huang (黃瑞安)
Gitlab
Gitlab
Tom Chen
Git and Github basic with SourceTree
Git and Github basic with SourceTree
Chu-Siang Lai
Visual Studio 2015 與 Git 開發實戰
Visual Studio 2015 與 Git 開發實戰
Will Huang
Git tutorial for windows user (給 Windows user 的 Git 教學)
Git tutorial for windows user (給 Windows user 的 Git 教學)
Cloud Tu
工程師必備第一工具 - Git
工程師必備第一工具 - Git
Alan Tsai
Git introduction
Git introduction
mythnc
寫給大家的 Git 教學
寫給大家的 Git 教學
littlebtc
Git & Sourcetree 介紹
Git & Sourcetree 介紹
Adison wu
Git in a nutshell
Git in a nutshell
Nelson Tai
Git
Git
Wei_hao
Git 入門與實作
Git 入門與實作
奕浦 郭
Mercurial簡介與教學
Mercurial簡介與教學
芳本 林
初心者 Git 上手攻略
初心者 Git 上手攻略
Lucien Lee
Android 程式設計(4)
Android 程式設計(4)
Roy Wang
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
Will Huang
Git基礎介紹
Git基礎介紹
Max Ma
Git Tutorial 教學
Git Tutorial 教學
Wen-Tien Chang
Git基础培训
Git基础培训
诸葛修车网-诸葛商城
Git與source tree 基礎教學
Git與source tree 基礎教學
Duncan Chen
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
Wen-Tien Chang
First meetingwithgit
First meetingwithgit
Rhythm Sun
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom up
Wen-Tien Chang
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
PingLun Liao
Git & git hub v1.2
Git & git hub v1.2
Chris Chen
Skyline 简介
Skyline 简介
琛琳 饶
DNS协议与应用简介
DNS协议与应用简介
琛琳 饶
Weitere ähnliche Inhalte
Was ist angesagt?
工程師必備第一工具 - Git
工程師必備第一工具 - Git
Alan Tsai
Git introduction
Git introduction
mythnc
寫給大家的 Git 教學
寫給大家的 Git 教學
littlebtc
Git & Sourcetree 介紹
Git & Sourcetree 介紹
Adison wu
Git in a nutshell
Git in a nutshell
Nelson Tai
Git
Git
Wei_hao
Git 入門與實作
Git 入門與實作
奕浦 郭
Mercurial簡介與教學
Mercurial簡介與教學
芳本 林
初心者 Git 上手攻略
初心者 Git 上手攻略
Lucien Lee
Android 程式設計(4)
Android 程式設計(4)
Roy Wang
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
Will Huang
Git基礎介紹
Git基礎介紹
Max Ma
Git Tutorial 教學
Git Tutorial 教學
Wen-Tien Chang
Git基础培训
Git基础培训
诸葛修车网-诸葛商城
Git與source tree 基礎教學
Git與source tree 基礎教學
Duncan Chen
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
Wen-Tien Chang
First meetingwithgit
First meetingwithgit
Rhythm Sun
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom up
Wen-Tien Chang
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
PingLun Liao
Git & git hub v1.2
Git & git hub v1.2
Chris Chen
Was ist angesagt?
(20)
工程師必備第一工具 - Git
工程師必備第一工具 - Git
Git introduction
Git introduction
寫給大家的 Git 教學
寫給大家的 Git 教學
Git & Sourcetree 介紹
Git & Sourcetree 介紹
Git in a nutshell
Git in a nutshell
Git
Git
Git 入門與實作
Git 入門與實作
Mercurial簡介與教學
Mercurial簡介與教學
初心者 Git 上手攻略
初心者 Git 上手攻略
Android 程式設計(4)
Android 程式設計(4)
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
Git基礎介紹
Git基礎介紹
Git Tutorial 教學
Git Tutorial 教學
Git基础培训
Git基础培训
Git與source tree 基礎教學
Git與source tree 基礎教學
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
First meetingwithgit
First meetingwithgit
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom up
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
Git & git hub v1.2
Git & git hub v1.2
Andere mochten auch
Skyline 简介
Skyline 简介
琛琳 饶
DNS协议与应用简介
DNS协议与应用简介
琛琳 饶
Logstash family introduction
Logstash family introduction
Owen Wu
Perl调用微博API实现自动查询应答
Perl调用微博API实现自动查询应答
琛琳 饶
Monitor is all for ops
Monitor is all for ops
琛琳 饶
{{more}} Kibana4
{{more}} Kibana4
琛琳 饶
ELK stack at weibo.com
ELK stack at weibo.com
琛琳 饶
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
琛琳 饶
More kibana
More kibana
琛琳 饶
Logstash
Logstash
琛琳 饶
Andere mochten auch
(10)
Skyline 简介
Skyline 简介
DNS协议与应用简介
DNS协议与应用简介
Logstash family introduction
Logstash family introduction
Perl调用微博API实现自动查询应答
Perl调用微博API实现自动查询应答
Monitor is all for ops
Monitor is all for ops
{{more}} Kibana4
{{more}} Kibana4
ELK stack at weibo.com
ELK stack at weibo.com
How ElasticSearch lives in my DevOps life
How ElasticSearch lives in my DevOps life
More kibana
More kibana
Logstash
Logstash
Ähnlich wie Add mailinglist command to gitolite
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)
flylon
Git使用进阶
Git使用进阶
Han Qin
Introduction to git
Introduction to git
Bo-Yi Wu
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報
Bachue Zhou
20170510 git 懶人包
20170510 git 懶人包
Chen-Ming Yang
為自己學 Git
為自己學 Git
昀 李
Git原理与实战 201607
Git原理与实战 201607
Charles Tang
Git 入门实战
Git 入门实战
icy leaf
Github简介及实用入门
Github简介及实用入门
Rongxing Liu
Git教學
Git教學
Sitg Yao
Git初步入門
Git初步入門
recast203
Code review on github training ( beginner )
Code review on github training ( beginner )
JS Lee
Git Flow 管理
Git Flow 管理
Pu Lee
Git server account management
Git server account management
PingLun Liao
Git 教學
Git 教學
Ming-Sian Lin
Git & git flow
Git & git flow
Amo Wu
Git and git hub
Git and git hub
唯 李
Git Tutorial
Git Tutorial
Drake Huang
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
Philip Zheng
Learning to Use Git | WeiYuan
Learning to Use Git | WeiYuan
Wei-Yuan Chang
Ähnlich wie Add mailinglist command to gitolite
(20)
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git使用进阶
Git使用进阶
Introduction to git
Introduction to git
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報
20170510 git 懶人包
20170510 git 懶人包
為自己學 Git
為自己學 Git
Git原理与实战 201607
Git原理与实战 201607
Git 入门实战
Git 入门实战
Github简介及实用入门
Github简介及实用入门
Git教學
Git教學
Git初步入門
Git初步入門
Code review on github training ( beginner )
Code review on github training ( beginner )
Git Flow 管理
Git Flow 管理
Git server account management
Git server account management
Git 教學
Git 教學
Git & git flow
Git & git flow
Git and git hub
Git and git hub
Git Tutorial
Git Tutorial
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
Learning to Use Git | WeiYuan
Learning to Use Git | WeiYuan
Add mailinglist command to gitolite
1.
Gitolite
2.
基础原理 • • • • gitolite的最基本原理(基于ssh的git命令): git clone git@host:repo.git 等价于 ssh
git@host 'git-upload-pack repo.git' • git push • 等价于 • ssh git@host 'git-receive-pack repo.git'
3.
如何插入gitolite • 如何“劫持”掉ssh上来的git-*命令? • 秘密在~/.ssh/authorized_keys里:
4.
原理实现 • • • • gitolite实际效果: git clone git@host:repo.git 等价于 ssh
git@host '/home/git/bin/gitolite-shell chenlin.rao SSH_ORIGINAL_COMMAND="git-upload-pack repo.git"' • git push • 等价于 • ssh git@host '/home/git/bin/gitolite-shell chenlin.rao SSH_ORIGINAL_COMMAND="git-receive-pack repo.git"'
5.
gitolite-shell实现 • 设置GL_USER环境变量 • 解析校验sshd设置的SSH_ORIGINAL_COMMAND环境变量 匹配git-upload-pack|git-receive-pack|git-upload-archive的就是git命令 匹配$rc{COMMANDS}的就是gitolite命令 • • • • • 设置GL_REPO环境变量 检查是否存在,不存在且允许的话就创建新repo 检查GL_BYPASS_ACCESS_CHECKS环境变量是否可以跳过 调用Gitolite::Conf::Load::access()函数检查操作权限 调用常规git命令
/ 调用gitolite command脚本
6.
gitolite.rc • 整个文件就存了一个%rc大哈希,各种配置。 • • • • • • • • • • • • • GIT_CONFIG_KEYS ROLES =>
{ READERS => WRITERS => }, LOCAL_CODE => ENABLE => [ 'help', 'desc', 'info', 'perms', 'writable', ] => 'hooks.*', #允许git_config调用的key 1, 1, "$ENV{HOME}/.gitolite", #存放hooks、logs等的位置 # 默认可用的gitolite command列表
7.
gitolite command • gitolite支持的command,脚本判断逻辑分成: – – – – – setup compile trigger list-phy-repos _which("commands/$command",
'x') • 所以主要的特殊命令都是在~/bin/commands/下通过一个个同名脚 本实现的。一共有26个——但是注意之前gitolite.rc里有开关,默认 只开了5个。 • 脚本不要求是Perl,实际上也有不少是Bash写的。
8.
gitolite hooks • 在创建repo的时候,Gitolite::Conf::Store::new_repo里在git init
--bare之后还调用了一个hook_1()函数。这个函数干的事情: # propagate user-defined (custom) hooks to all repos ln_sf( "$rc{LOCAL_CODE}/hooks/common", "*", "$repo.git/hooks" ) if $rc{LOCAL_CODE}; # override/propagate gitolite defined hooks for all repos ln_sf( "$rc{GL_ADMIN_BASE}/hooks/common", "*", "$repo.git/hooks" ); # override/propagate gitolite defined hooks for the admin repo ln_sf( "$rc{GL_ADMIN_BASE}/hooks/gitolite-admin", "*", "$repo.git/hooks" ) if $repo eq 'gitolite-admin';
9.
repo specific hook •
通过trigger触发 • 必须通过gitolite-options.hooks.*设定 • 同样需要在.gitolite.rc配置中开启才能使 用
10.
mailinglist实现
11.
mailinglist解释 • 整个%config模仿了Gitolite::Conf::Store和 Gitolite::Conf::Load • 因为gitolite
git-config命令,采用的 Gitolite::Conf::Load::git_config()里会强制使用$repo.git/glconf文件里的%one_repo和%one_config。而最重要的access() 等函数都会用到这个git_config的返回值。
12.
总结 • 实现mailinglist命令行操作需要: 1. 修改.gitolite.rc文件,添加ENABLE数组里的命令,编辑 允许的GIT_CONFIG_KEYS; 2.
在.gitolite/hooks/common/下创建post-receive文件 ,即git默认的post-receive-email 3. 在bin/commands/下创建mailinglist程序
Jetzt herunterladen