1,查看环境
系统版本CentOS6.4,内网ip为10.5.10.145
- Last login: Sun Nov 22 00:54:21 2015 from 192.168.21.2
- [root@Android ~]# lsb_release -a
- -bash: lsb_release: command not found
- [root@Android ~]# cat /etc/redhat-release
- CentOS release 6.4 (Final)
- [root@Android ~]# df -Th
- 文件系统 类型 容量 已用 可用 已用%% 挂载点
- /dev/mapper/vg_andr0id-lv_root
- ext4 50G 1.1G 46G 3% /
- tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
- /dev/sda1 ext4 485M 32M 428M 7% /boot
- /dev/mapper/vg_andr0id-lv_home
- ext4 864G 200M 820G 1% /home
- [root@Android ~]# ifconfig
- eth0 Link encap:Ethernet HWaddr 00:E0:4C:36:07:DD
- inet addr:10.5.10.145 Bcast:10.5.10.255 Mask:255.255.255.0
- inet6 addr: fe80::2e0:4cff:fe36:7dd/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:55550 errors:0 dropped:0 overruns:0 frame:0
- TX packets:233 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:3887551 (3.7 MiB) TX bytes:27350 (26.7 KiB)
- lo Link encap:Local Loopback
- inet addr:127.0.0.1 Mask:255.0.0.0
- inet6 addr: ::1/128 Scope:Host
- UP LOOPBACK RUNNING MTU:16436 Metric:1
- RX packets:0 errors:0 dropped:0 overruns:0 frame:0
- TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
2,搭建git服务器
1)安装支持库
[root@Android ~]# sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
Loaded plugins: fastestmirror
base | 3.7 kB 00:00
base/primary_db | 4.6 MB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 33 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 2.6 MB 00:01
Setting up Install Process
Resolving Dependencies
....
Complete!
2)安装git
下载最新的稳定版本github.com/git/git
当前最新的时V2.6.3,上传到服务器
编译安装
增加软链接
- mv git-2.6.3.tar.gz /usr/local/src/
- cd /usr/local/src
- tar -zvxf git-2.6.3.tar.gz
- cd git-2.6.3
- sudo make prefix=/usr/local/git all
- 报错,找不到cc,安装gcc
- yum install gcc
- sudo make prefix=/usr/local/git all
- make prefix=/usr/local/git install
git安装完成
- [root@Android git-2.6.3]# ln -s /usr/local/git/bin/* /usr/bin/
- 校验安装成功
- [root@Android git-2.6.3]# git --version
- git version 2.6.3
- [root@Android git-2.6.3]#
3)安装gitosis
- [root@Android ~]# sudo yum install python python-setuptools
- ....
- Installed:
- python-setuptools.noarch 0:0.6.10-3.el6
- Updated:
- python.x86_64 0:2.6.6-64.el6
- Dependency Updated:
- python-libs.x86_64 0:2.6.6-64.el6
- Complete!
- [root@Android ~]# cd /usr/local/src
- [root@Android src]# git clone git://github.com/res0nat0r/gitosis.git
- 正克隆到 'gitosis'...
- remote: Counting objects: 727, done.
- remote: Total 727 (delta 0), reused 0 (delta 0), pack-reused 727
- 接收对象中: 100% (727/727), 179.61 KiB | 98.00 KiB/s, 完成.
- 处理 delta 中: 100% (407/407), 完成.
- 检查连接... 完成。
- [root@Android src]# cd gitosis
- [root@Android gitosis]# python setup.py install
- running install
- running bdist_egg
- running egg_info
- creating gitosis.egg-info
- writing requirements to gitosis.egg-info/requires.txt
- ....
- Installed /usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg
- Processing dependencies for gitosis==0.2
- Searching for distribute==0.6.10
- Best match: distribute 0.6.10
- Adding distribute 0.6.10 to easy-install.pth file
- Installing easy_install script to /usr/bin
- Installing easy_install-2.6 script to /usr/bin
- Using /usr/lib/python2.6/site-packages
- Finished processing dependencies for gitosis==0.2
- [root@Android gitosis]#
4)在本机生成密钥,上传服务器
呃。。。。大概就这么个意思。。。。
- senrsl@senrsl-T540p:~$ ssh-keygen -t rsa
- Generating public/private rsa key pair.
- Enter file in which to save the key (/home/senrsl/.ssh/id_rsa):
- /home/senrsl/.ssh/id_rsa already exists.
- Overwrite (y/n)? n
- senrsl@senrsl-T540p:~$ scp ~/.ssh/id_rsa.pub root@10.5.10.145:/tmp
- root@10.5.10.145's password:
- bash: scp: command not found
- lost connection
- senrsl@senrsl-T540p:~$ scp ?
5)生成git用户,初始化gitosis
- #a.创建git版本管理用户
- [root@Android ~]# sudo useradd -c 'git version manage' -m -d /home/git -s /bin/bash git
- #b.更改密码
- [root@Android ~]# passwd git
- 更改用户 git 的密码 。
- 新的 密码:
- 重新输入新的 密码:
- passwd: 所有的身份验证令牌已经成功更新。
- #c.su到用户
- [root@Android ~]# su - git
- #d.初始化版本库
- [git@Android ~]$ gitosis-init < /tmp/id_rsa.pub
- 初始化空的 Git 仓库于 /home/git/repositories/gitosis-admin.git/
- 重新初始化现存的 Git 仓库于 /home/git/repositories/gitosis-admin.git/
- #e.删除密钥
- [git@Android ~]$ rm -rf /tmp/id_rsa.pub
- rm: 无法删除"/tmp/id_rsa.pub": 不允许的操作
- [git@Android ~]$ sudo rm -rf /tmp/id_rsa.pub
- We trust you have received the usual lecture from the local System
- Administrator. It usually boils down to these three things:
- #1) Respect the privacy of others.
- #2) Think before you type.
- #3) With great power comes great responsibility.
- [sudo] password for git:
- git 不在 sudoers 文件中。此事将被报告。
- [git@Android ~]$ ll /tmp/
- 总用量 4
- -rw-r--r-- 1 root root 401 11月 22 03:09 id_rsa.pub
- -rw-------. 1 root root 0 11月 21 00:40 yum.log
- [git@Android ~]$ su
- 密码:
- [root@Android git]# rm -rf /tmp/id_rsa.pub
- [root@Android git]#
6)本机上导出项目管理仓库
7)在本机增加及设置管理项目
- senrsl@senrsl-T540p:~/test$ mkdir -p repo
- senrsl@senrsl-T540p:~/test$ cd repo/
- senrsl@senrsl-T540p:~/test/repo$ git clone git@10.5.10.145:gitosis-admin.git
- 正克隆到 'gitosis-admin'...
- remote: 对象计数中: 5, 完成.
- remote: 压缩对象中: 100% (5/5), 完成.
- remote: Total 5 (delta 0), reused 5 (delta 0)
- 接收对象中: 100% (5/5), done.
- 检查连接... 完成。
8)在本机上初始,增加及使用项目test-git
- senrsl@senrsl-T540p:~/test/repo$ cd gitosis-admin/
- #查看git服务器上已上传密钥
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ ls keydir/
- senrsl@senrsl-T540p.pub
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ cat keydir/senrsl@senrsl-T540p.pub
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6156/NAf9V+74M5vNkg+4ejMl8oSUfOIooxtTG28aIz6jtF4D/CEVjjVwSfPZI8X+e13Y62L8gBL5P2BFJcyoFHSG3u6HsizR3oflg4ajlEmm3ZvnnxrdDUx75sw29MpWRTgIqVps2GprdCAuaIXzQ29x3sgaE95JoJZryxwyPO369zy1iRjKZACODYhF+8yCFaoRA5HqiJe/wYxvaLlW78FmDaDyxBS44iiOAucnyXQUVC2rW1XQ7eI0Vi9W+FEugWF7JuDbyT4yJvqsbSH7muv0tfzzHpdXKmvWOcIbOSAGcRi3RjNGh0QlINkzjCkGbdt0cecxIly75u/XD565 senrsl@senrsl-T540p
- #更改配置文件为,在后面加上下面
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ gedit gitosis.conf
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ cat gitosis.conf
- [gitosis]
- [group gitosis-admin]
- members = senrsl@senrsl-T540p
- writable = gitosis-admin
- [group test-git] # 具有写权限的组名称
- writable = test-git # 该组可写的项目名称
- members = senrsl@senrsl-T540p #该组的成员(密钥用户名) 多个用户协同开发时,以空格分隔
- # 如果要增加只读的组 参考如下
- # [group test-git-readnoly] # 具有都权限的组名称
- # readonly = test-git # 该组只读的项目名称
- # members = senrsl@senrsl-T540p # 该组的成员
- #提交修改
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ git add .
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ git commit -a -m 'add test-git repo'
- [master c4678cb] add test-git repo
- 2 files changed, 26 insertions(+)
- create mode 100644 gitosis.conf~
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ git push
- warning: push.default 尚未设置,它的默认值在 Git 2.0 从 'matching'
- 变更为 'simple'。若要不再显示本信息并保持传统习惯,进行如下设置:
- git config --global push.default matching
- 若要不再显示本信息并从现在开始采用新的使用习惯,设置:
- git config --global push.default simple
- 当 push.default 设置为 'matching' 后,git 将推送和远程同名的所有
- 本地分支。
- 从 Git 2.0 开始,Git 缺省采用更为保守的 'simple' 模式,只推送当前
- 分支到远程关联的同名分支,即 'git push' 推送当前分支。
- 参见 'git help config' 并查找 'push.default' 以获取更多信息。
- ('simple' 模式由 Git 1.7.11 版本引入。如果您有时要使用老版本的 Git,
- 为保持兼容,请用 'current' 代替 'simple')
- Counting objects: 6, done.
- Delta compression using up to 8 threads.
- Compressing objects: 100% (4/4), done.
- Writing objects: 100% (4/4), 649 bytes | 0 bytes/s, done.
- Total 4 (delta 1), reused 0 (delta 0)
- To git@10.5.10.145:gitosis-admin.git
- a455dcb..c4678cb master -> master
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$
9)增加协同开发者的公钥到git服务器
- senrsl@senrsl-T540p:~/test/repo$ mkdir test-git
- senrsl@senrsl-T540p:~/test/repo$ cd test-git/
- senrsl@senrsl-T540p:~/test/repo/test-git$ git init
- 初始化空的 Git 版本库于 /home/senrsl/test/repo/test-git/.git/
- senrsl@senrsl-T540p:~/test/repo/test-git$ touch README
- senrsl@senrsl-T540p:~/test/repo/test-git$ git add .
- senrsl@senrsl-T540p:~/test/repo/test-git$ git commit -a -m 'init test-git'
- [master (根提交) 60dbe0f] init test-git
- 1 file changed, 0 insertions(+), 0 deletions(-)
- create mode 100644 README
- senrsl@senrsl-T540p:~/test/repo/test-git$ git remote add origin git@10.5.10.145:test-git.git
- senrsl@senrsl-T540p:~/test/repo/test-git$ git push origin master
- 初始化空的 Git 仓库于 /home/git/repositories/test-git.git/
- Counting objects: 3, done.
- Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.
- Total 3 (delta 0), reused 0 (delta 0)
- To git@10.5.10.145:test-git.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/test-git$
把协同开发者的id_rsa.pub文件里的数据拷贝到对应开发者的【密钥用户名.pub】文件,如把a@b的id_rsa.pub文件中文本粘 贴到a@b.pub文 件里,并保存,然后将添加数据后的目录commit到服务器。
- senrsl@senrsl-T540p:~/test/repo/test-git$ cd ../gitosis-admin/keydir/
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin/keydir$ ll
- 总用量 12
- drwxrwxr-x 2 senrsl senrsl 4096 11月 21 20:21 ./
- drwxrwxr-x 4 senrsl senrsl 4096 11月 21 20:24 ../
- -rw-rw-r-- 1 senrsl senrsl 401 11月 21 20:21 senrsl@senrsl-T540p.pub
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin/keydir$
10)进阶1:添加已有git项目
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git status
- 位于分支 android-3.4
- 您的分支与上游分支 'origin/android-3.4' 一致。
- 无文件要提交,干净的工作区
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git branch
- * android-3.4
- master
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git remote -v
- origin https://android.googlesource.com/kernel/common.git (fetch)
- origin https://android.googlesource.com/kernel/common.git (push)
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git clone --mirror android-3.4 kernel-android-common3.4.git
- fatal: 版本库 'android-3.4' 不存在
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git clone --mirror common kernel-android-common3.4.git
- fatal: 版本库 'common' 不存在
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git clone --mirror common common.git
- fatal: 版本库 'common' 不存在
- senrsl@senrsl-T540p:~/android/source/kernel/common$ cd ..
- senrsl@senrsl-T540p:~/android/source/kernel$ git clone --mirror common kernel-android-common.git
- 克隆到裸版本库 'kernel-android-common.git'...
- 完成。
- senrsl@senrsl-T540p:~/android/source/kernel$ mv kernel-android-common.git 服务器上的/home/git/repositories/
- senrsl@senrsl-T540p:~/android/source/kernel$
配置这个仓库的权限
- senrsl@senrsl-T540p:~/android/source/kernel$ cd ~/test/repo/
- senrsl@senrsl-T540p:~/test/repo$ gedit gitosis-admin/gitosis.conf
- 后面增加这个
- [group kernel-android-common] # 具有写权限的组名称
- writable = kernel-android-common # 该组可写的项目名称
- members = senrsl@senrsl-T540p #该组的成员(密钥用户名) 多个用户协同开发时,以空格分隔
把这个文件夹放到服务器上,然后挪到git库目录去
- [root@Android ~]# mv kernel-android-common.git /home/git/repositories/
- #变更用户及分组为git
- [root@Android ~]# chown -R git.git /home/git/repositories/kernel-android-common.git
- [root@Android ~]# ll /home/git/repositories/
- 总用量 12
- drwxr-x--- 7 git git 4096 11月 22 04:25 gitosis-admin.git
- drwxrwxr-x 7 git git 4096 11月 21 21:27 kernel-android-common.git
- drwxr-x--- 6 git git 4096 11月 22 04:31 test-git.git
然后本地提交管理组配置
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ git status
- 位于分支 master
- 您的分支与上游分支 'origin/master' 一致。
- 尚未暂存以备提交的变更:
- (使用 "git add/rm <file>..." 更新要提交的内容)
- (使用 "git checkout -- <file>..." 丢弃工作区的改动)
- 修改: gitosis.conf
- 删除: gitosis.conf~
- 修改尚未加入提交(使用 "git add" 和/或 "git commit -a")
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ git add --all
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ git commit -m 'add kernel-android-common.git'
- [master 3d4e573] add kernel-android-common.git
- 2 files changed, 4 insertions(+), 16 deletions(-)
- delete mode 100644 gitosis.conf~
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ git push origin master
- Counting objects: 5, done.
- Delta compression using up to 8 threads.
- Compressing objects: 100% (3/3), done.
- Writing objects: 100% (3/3), 349 bytes | 0 bytes/s, done.
- Total 3 (delta 1), reused 0 (delta 0)
- To git@10.5.10.145:gitosis-admin.git
- c4678cb..3d4e573 master -> master
- senrsl@senrsl-T540p:~/test/repo/gitosis-admin$ cd ..
克隆这个库回来
上去之前是俩分支,回来就剩一个分支了。。。。
- senrsl@senrsl-T540p:~/test/repo$ git clone git@10.5.10.145:kernel-android-common.git
- 正克隆到 'kernel-android-common'...
- remote: 对象计数中: 2464763, 完成.
- remote: 压缩对象中: 100% (382116/382116), 完成.
- remote: Total 2464763 (delta 2059484), reused 2462494 (delta 2058434)
- 接收对象中: 100% (2464763/2464763), 541.68 MiB | 11.20 MiB/s, done.
- 处理 delta 中: 100% (2059484/2059484), done.
- 检查连接... 完成。
- Checking out files: 100% (38857/38857), done.
- senrsl@senrsl-T540p:~/test/repo$ cd kernel-android-common/
- senrsl@senrsl-T540p:~/test/repo/kernel-android-common$ git branch
- * android-3.4
- senrsl@senrsl-T540p:~/test/repo/kernel-android-common$ git map
之前的分支:
- #远程分支
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git branch -a
- * android-3.4
- master
- remotes/origin/HEAD -> origin/master
- remotes/origin/android-2.6.39
- remotes/origin/android-3.0
- remotes/origin/android-3.10
- remotes/origin/android-3.10-adf
- remotes/origin/android-3.10.y
- remotes/origin/android-3.14
- remotes/origin/android-3.18
- remotes/origin/android-3.3
- remotes/origin/android-3.4
- remotes/origin/android-3.4-compat
- remotes/origin/bcmdhd-3.10
- remotes/origin/coupled-cpuidle
- remotes/origin/experimental/android-3.10
- remotes/origin/experimental/android-3.10-rc5
- remotes/origin/experimental/android-3.14
- remotes/origin/experimental/android-3.18
- remotes/origin/experimental/android-3.8
- remotes/origin/experimental/android-3.9
- remotes/origin/experimental/android-3.9-rc2
- remotes/origin/experimental/android-3.9-rc7
- remotes/origin/linux-bcm43xx-2.6.39
- remotes/origin/master
- #本地分支
- senrsl@senrsl-T540p:~/android/source/kernel/common$ git branch
- * android-3.4
- master
- senrsl@senrsl-T540p:~/android/source/kernel/common$
之后的分支
这是把之前的检出的分支当做了远程分支,之前没检出的就不见了啊。。。。
- #远程分支
- senrsl@senrsl-T540p:~/test/repo/kernel-android-common$ git branch -a
- * android-3.4
- remotes/origin/HEAD -> origin/android-3.4
- remotes/origin/android-3.4
- remotes/origin/master
- #本地分支
- senrsl@senrsl-T540p:~/test/repo/kernel-android-common$ git branch
- * android-3.4
- senrsl@senrsl-T540p:~/test/repo/kernel-android-common$
怎么让服务器上的那个继续去官方拉代码呢?
3,搭建repo服务器
1) 创建repo管理权限用户dc,在该用户权限下初始化mainfest.git库
2)安装守护进程git-daemon
- [root@Android /]# useradd -c 'repo manager' -m -d /home/dc -s /bin/bash dc
- [root@Android /]# passwd dc
- 更改用户 dc 的密码 。
- 新的 密码:
- 无效的密码: 它基于字典单词
- 无效的密码: 过于简单
- 重新输入新的 密码:
- passwd: 所有的身份验证令牌已经成功更新。
- [root@Android /]# su - dc
- [dc@Android ~]$ ll /home/
- 总用量 24
- drwx------ 3 dc dc 4096 11月 22 22:59 dc
- drwx------ 6 git git 4096 11月 22 06:23 git
- drwx------. 2 root root 16384 11月 21 00:40 lost+found
- [dc@Android ~]$ pwd
- /home/dc
- [dc@Android ~]$ mkdir repos
- [dc@Android ~]$ cd repos/
- [dc@Android repos]$ git init --bare manifest.git
- 初始化空的 Git 仓库于 /home/dc/repos/manifest.git/
- [dc@Android repos]$ git init --bare pro/pro1.git
- 初始化空的 Git 仓库于 /home/dc/repos/pro/pro1.git/
- [dc@Android repos]$ git init --bare pro/pro2.git
- 初始化空的 Git 仓库于 /home/dc/repos/pro/pro2.git/
- [dc@Android repos]$ git init --bare pro3.git
- 初始化空的 Git 仓库于 /home/dc/repos/pro3.git/
- [dc@Android repos]$
在ubuntu上是senrsl@senrsl-T540p:~$ sudo apt-get install git-daemon-run
在centos上没有这个。。。。
然后尝试安装[root@Android repos]# yum install git-daemon
坑了,结果安上一堆东西,把原来的git都给覆盖成1.7.1版了。。。。
然后挨个卸载,重新加git软链接,测试运行。。。。
然后研究了半天文档(git-scm.com/book/zh/v2/服务器上的-Git-Git-守护进程),他应该就是一个脚本,一直在运 行,然后监测git服务是否正常运行
试了下文档上的这句
上面那句命令会一直运行着。。。。
- [root@Android repos]# su - dc
- [dc@Android ~]$ pwd
- /home/dc
- [dc@Android ~]$ git daemon --reuseaddr --base-path=/home/git/ /home/git/
- ^Z
- [1]+ Stopped git daemon --reuseaddr --base-path=/home/git/ /home/git/
- [dc@Android ~]$
然后按文档所说的,写个脚本放到/etc/event.d/local-git-daemon,建一个对仓库拥有只读权限的用户来运行这个脚本。
对于git-daemon,也可以自己编译安装,这样版本就对了
然后找到了这个
[dc@Android git-core]$ ls git-da*
git-daemon
[dc@Android git-core]$ pwd
/usr/local/git/libexec/git-core
其实已经编译好了。。。。
可惜不知道怎么用!!!
尝试执行一下
- [dc@Android git-core]$ ./git-daemon
- [6178] Could not bind to 0.0.0.0: ??????
- [6178] Could not bind to ::: ??????
- fatal: unable to allocate any listen sockets on port 9418
- [dc@Android git-core]$
好吧,还是按文档上说的自己试着建脚本吧。。。。
首先,建一个对仓库只读权限的用户
对仓库只读权限的用户,这个怎么搞。。。。
- [root@Android event.d]# sudo useradd -c 'git read only' -m -d /home/git-ro -s /bin/bash git-ro
- [root@Android ~]# passwd git-ro
- #软链接
- [root@Android ~]# ln -s /home/git/repositories/ /home/git-ro/
- [root@Android event.d]# vi local-git-daemon
- [root@Android event.d]# cat local-git-daemon
- start on startup
- stop on shutdown
- exec /usr/bin/git daemon \
- --export-all \
- --user=git-ro --group=git-ro \
- --reuseaddr \
- --base-path=/home/git/ \
- /home/git/
- respawn
- [root@Android event.d]#
其中--export-all是给所有git仓库进行非授权访问,如果不加这个,那么就要在每个罗仓库中增加这个文件
问题遗留:
- [git@Android repositories]$ cd test-git.git/
- [git@Android test-git.git]$ ll
- 总用量 24
- -rw-r--r-- 1 git git 66 11月 22 04:31 config
- -rw-r--r-- 1 git git 23 11月 22 04:31 HEAD
- drwxr-xr-x 2 git git 4096 11月 22 04:31 hooks
- drwxr-xr-x 2 git git 4096 11月 22 23:34 info
- drwxr-xr-x 10 git git 4096 11月 22 23:34 objects
- drwxr-xr-x 4 git git 4096 11月 22 04:31 refs
- [git@Android test-git.git]$ touch git-daemon-export-ok
①git-ro只读权限,何解?
②自启动脚本无法运行
[root@Android event.d]# initctl start local-git-daemon
initctl: Unknown job: local-git-daemon
3)定制mainfest.git
这个地方刚先配置了 gitosis.conf,后来发现不配也行。。。。
其中default.xml内容
- senrsl@senrsl-T540p:~/test/repo$ git clone dc@10.5.10.145:manifest.git
- 正克隆到 'manifest'...
- dc@10.5.10.145's password:
- fatal: 'manifest.git' does not appear to be a git repository
- fatal: Could not read from remote repository.
- Please make sure you have the correct access rights
- and the repository exists.
- senrsl@senrsl-T540p:~/test/repo$ git clone dc@10.5.10.145:/home/dc/repos/manifest.git
- 正克隆到 'manifest'...
- dc@10.5.10.145's password:
- warning: 您似乎克隆了一个空版本库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo$ cd manifest/
- senrsl@senrsl-T540p:~/test/repo/manifest$ touch default.xml
- senrsl@senrsl-T540p:~/test/repo/manifest$ gedit default.xml
- senrsl@senrsl-T540p:~/test/repo/manifest$ git add .
- senrsl@senrsl-T540p:~/test/repo/manifest$ git commit -m 'add default.xml'
- [master (根提交) 1e4054e] add default.xml
- 2 files changed, 16 insertions(+)
- create mode 100644 default.xml
- create mode 100644 default.xml~
- senrsl@senrsl-T540p:~/test/repo/manifest$ git push origin master
- dc@10.5.10.145's password:
- Counting objects: 3, done.
- Delta compression using up to 8 threads.
- Compressing objects: 100% (3/3), done.
- Writing objects: 100% (3/3), 385 bytes | 0 bytes/s, done.
- Total 3 (delta 0), reused 0 (delta 0)
- To dc@10.5.10.145:/home/dc/repos/manifest.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/manifest$
4)初始化那三个测试仓库
- senrsl@senrsl-T540p:~/test/repo/manifest$ cat default.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <manifest>
- <remote name="origin" fetch="git://10.5.10.145/repos"/>
- <default revision="master" remote="origin" />
- <project path="pro/pro1" name="pro/pro1" />
- <project path="pro/pro2" name="pro/pro2" />
- <project path="pro3" name="pro3" />
- </manifest>
- senrsl@senrsl-T540p:~/test/repo/manifest$
5)服务器安装repo工具
- senrsl@senrsl-T540p:~/test/repo/manifest$ cd ..
- senrsl@senrsl-T540p:~/test/repo$ git clone dc@10.5.10.145:/home/dc/repos/pro/pro1.git
- 正克隆到 'pro1'...
- dc@10.5.10.145's password:
- warning: 您似乎克隆了一个空版本库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo$ git clone dc@10.5.10.145:/home/dc/repos/pro/pro2.git
- 正克隆到 'pro2'...
- dc@10.5.10.145's password:
- warning: 您似乎克隆了一个空版本库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo$ git clone dc@10.5.10.145:/home/dc/repos/pro3.git
- 正克隆到 'pro3'...
- dc@10.5.10.145's password:
- warning: 您似乎克隆了一个空版本库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo$ ll
- 总用量 36
- drwxrwxr-x 9 senrsl senrsl 4096 11月 22 18:52 ./
- drwxrwxr-x 7 senrsl senrsl 4096 11月 21 19:34 ../
- drwxrwxr-x 4 senrsl senrsl 4096 11月 22 17:48 gitosis-admin/
- drwxrwxr-x 25 senrsl senrsl 4096 11月 21 21:54 kernel-android-common/
- drwxrwxr-x 3 senrsl senrsl 4096 11月 22 18:48 manifest/
- drwxrwxr-x 3 senrsl senrsl 4096 11月 22 18:51 pro1/
- drwxrwxr-x 3 senrsl senrsl 4096 11月 22 18:52 pro2/
- drwxrwxr-x 3 senrsl senrsl 4096 11月 22 18:52 pro3/
- drwxrwxr-x 3 senrsl senrsl 4096 11月 21 20:29 test-git/
- senrsl@senrsl-T540p:~/test/repo$ cd pro1/
- senrsl@senrsl-T540p:~/test/repo/pro1$ touch README
- senrsl@senrsl-T540p:~/test/repo/pro1$ echo 'test'>>README
- senrsl@senrsl-T540p:~/test/repo/pro1$ cp README ../pro2/
- senrsl@senrsl-T540p:~/test/repo/pro1$ cp README ../pro3/
- senrsl@senrsl-T540p:~/test/repo/pro1$ git add --all / git add .
- fatal: /:'/' 在版本库之外
- senrsl@senrsl-T540p:~/test/repo/pro1$ git status
- 位于分支 master
- 初始提交
- 未跟踪的文件:
- (使用 "git add <file>..." 以包含要提交的内容)
- README
- 提交为空,但是存在尚未跟踪的文件(使用 "git add" 建立跟踪)
- senrsl@senrsl-T540p:~/test/repo/pro1$ git add .
- senrsl@senrsl-T540p:~/test/repo/pro1$ git commit -m 'init'
- [master (根提交) a47f3f4] init
- 1 file changed, 1 insertion(+)
- create mode 100644 README
- senrsl@senrsl-T540p:~/test/repo/pro1$ git push origin master
- dc@10.5.10.145's password:
- Counting objects: 3, done.
- Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.
- Total 3 (delta 0), reused 0 (delta 0)
- To dc@10.5.10.145:/home/dc/repos/pro/pro1.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/pro1$ cd ..
- senrsl@senrsl-T540p:~/test/repo$ cd pro
- bash: cd: pro: 没有那个文件或目录
- senrsl@senrsl-T540p:~/test/repo$ cd pro2/
- senrsl@senrsl-T540p:~/test/repo/pro2$ git add .
- senrsl@senrsl-T540p:~/test/repo/pro2$ git commit -m 'init2'
- [master (根提交) 3c94f3a] init2
- 1 file changed, 1 insertion(+)
- create mode 100644 README
- senrsl@senrsl-T540p:~/test/repo/pro2$ git push origin master
- dc@10.5.10.145's password:
- Counting objects: 3, done.
- Writing objects: 100% (3/3), 206 bytes | 0 bytes/s, done.
- Total 3 (delta 0), reused 0 (delta 0)
- To dc@10.5.10.145:/home/dc/repos/pro/pro2.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/pro2$ cd ../pro3
- senrsl@senrsl-T540p:~/test/repo/pro3$ git add .
- senrsl@senrsl-T540p:~/test/repo/pro3$ git commit -m 'init'
- [master (根提交) 3ca740f] init
- 1 file changed, 1 insertion(+)
- create mode 100644 README
- senrsl@senrsl-T540p:~/test/repo/pro3$ git push origin master
- dc@10.5.10.145's password:
- Counting objects: 3, done.
- Writing objects: 100% (3/3), 205 bytes | 0 bytes/s, done.
- Total 3 (delta 0), reused 0 (delta 0)
- To dc@10.5.10.145:/home/dc/repos/pro3.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/pro3$
- [root@Android ~]# su - dc
- [dc@Android ~]$ ll
- 总用量 4
- drwxrwxr-x 5 dc dc 4096 11月 23 03:04 repos
- [dc@Android ~]$ cd repos/
- [dc@Android repos]$ wget https://github.com/android/tools_repo/archive/master.zip
- --2015-11-23 03:08:20-- https://github.com/android/tools_repo/archive/master.zip
- ....
- [dc@Android repos]$ unzip master.zip
- Archive: master.zip
- e7a3bcbbb8083e812ce07a5459f0e6d30edfb9fe
- ....
- [dc@Android repos]$ mv tools_repo-master repo
- [dc@Android repos]$ ll
- 总用量 116
- drwxrwxr-x 7 dc dc 4096 11月 22 23:01 manifest.git
- -rw-rw-r-- 1 dc dc 100049 11月 23 03:08 master.zip
- drwxrwxr-x 4 dc dc 4096 11月 23 02:44 pro
- drwxrwxr-x 7 dc dc 4096 11月 23 02:44 pro3.git
- drwxrwxr-x 6 dc dc 4096 1月 11 2011 repo
- [dc@Android repos]$
给repo工具加入版本管理
- [dc@Android repos]$ cd repo/
- [dc@Android repo]$ git init
- 初始化空的 Git 仓库于 /home/dc/repos/repo/.git/
- [dc@Android repo]$ git add --all
- [dc@Android repo]$ git commit -m 'init'
6)本地测试repo
初始化报错
改成这样就好了。。。。至少能找到了
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=git://10.5.10.145/repos/repo --no-repo-verify --repo-branch=master –u git://10.5.10.145/repos/manifest.git
- fatal: manifest url (-u) is required.
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init -u git://10.5.10.145/repos/manifest.git
- Get git://10.5.10.145/repos/repo.git
- fatal: unable to connect to 10.5.10.145:
- 10.5.10.145[0: 10.5.10.145]: errno=没有到主机的路由
好吧,反应了半天,看来必须要安装git-damon-run.....
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=dc@10.5.10.145:/home/dc/repos/repo --no-repo-verify --repo-branch=master -u dc@10.5.10.145:/home/dc/repos/manifest.git
- Get dc@10.5.10.145:/home/dc/repos/repo
- dc@10.5.10.145's password:
- remote: 对象计数中: 57, 完成.
- remote: 压缩对象中: 100% (54/54), 完成.
- remote: Total 57 (delta 9), reused 0 (delta 0)
- Unpacking objects: 100% (57/57), done.
- 来自 10.5.10.145:/home/dc/repos/repo
- * [新分支] master -> origin/master
- Getting manifest ...
- from dc@10.5.10.145:/home/dc/repos/manifest.git
- dc@10.5.10.145's password: dc@10.5.10.145's password:
- Permission denied, please try again.
- dc@10.5.10.145's password:
- remote: 对象计数中: 12, 完成.
- remote: 压缩对象中: 100% (9/9), 完成.
- remote: Total 12 (delta 3), reused 0 (delta 0)
- Unpacking objects: 100% (12/12), done.
- 来自 10.5.10.145:/home/dc/repos/manifest
- * [新分支] master -> origin/master
- Traceback (most recent call last):
- File "/home/senrsl/test/repo/repo_test/.repo/repo/main.py", line 234, in <module>
- _Main(sys.argv[1:])
- File "/home/senrsl/test/repo/repo_test/.repo/repo/main.py", line 216, in _Main
- repo._Run(argv)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/main.py", line 121, in _Run
- cmd.Execute(copts, cargs)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/subcmds/init.py", line 272, in Execute
- self._SyncManifest(opt)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/subcmds/init.py", line 183, in _SyncManifest
- self._LinkManifest(opt.manifest_name)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/subcmds/init.py", line 198, in _LinkManifest
- self.manifest.Link(name)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 87, in Link
- self.Override(name)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 80, in Override
- self._Load()
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 232, in _Load
- self._ParseManifest(True)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 250, in _ParseManifest
- root = xml.dom.minidom.parse(self._manifestFile)
- File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
- return expatbuilder.parse(file)
- File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
- result = builder.parseFile(fp)
- File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
- parser.Parse(buffer, 0)
- xml.parsers.expat.ExpatError: XML declaration not well-formed: line 1, column 19
- senrsl@senrsl-T540p:~/test/repo/repo_test$
senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=git://10.5.10.145/repos/repo --no-repo-verify --repo-branch=master -u git://10.5.10.145/repos/manifest.git
Get git://10.5.10.145/repos/repo
fatal: unable to connect to 10.5.10.145:
10.5.10.145[0: 10.5.10.145]: errno=没有到主机的路由
我屮,我屮,我屮
大晚上的折腾好几个小时,在服务器上把防火墙关了,返回的错误立马就变了。。。。
日志变了
- Last login: Mon Nov 23 05:28:01 2015 from 192.168.21.2
- [root@Android ~]# /etc/init.d/iptables stop
- iptables:清除防火墙规则: [确定]
- iptables:将链设置为政策 ACCEPT:filter [确定]
- iptables:正在卸载模块: [确定]
- [root@Android ~]#
....
然后。。。。
把用户换一下
root运行的时候,客户机就可以拉去repo代码,但是项目代码报错
- [root@Android ~]# git daemon --export-all --user=dc --group=dc --reuseaddr --base-path=/home/dc /home/dc
- ^C
- [root@Android ~]# su - dc
- [dc@Android ~]$ git daemon --export-all --user=dc --group=dc --reuseaddr --base-path=/home/dc /home/dc
- fatal: cannot drop privileges
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=git://10.5.10.145/repos/repo --no-repo-verify --repo-branch=master -u git://10.5.10.145/repos/manifest.git
- Get git://10.5.10.145/repos/repo
- remote: warning: 不能访问 '/root/.config/git/attributes':????
- remote: 对象计数中: 57, 完成.
- remote: 压缩对象中: 100% (54/54), 完成.
- remote: Total 57 (delta 9), reused 0 (delta 0)
- Unpacking objects: 100% (57/57), done.
- 来自 git://10.5.10.145/repos/repo
- * [新分支] master -> origin/master
- Getting manifest ...
- from git://10.5.10.145/repos/manifest.git
- remote: warning: 不能访问 '/root/.config/git/attributes':????
- remote: 对象计数中: 16, 完成.
- remote: 压缩对象中: 100% (12/12), 完成.
- remote: Total 16 (delta 4), reused 0 (delta 0)
- Unpacking objects: 100% (16/16), done.
- 来自 git://10.5.10.145/repos/manifest
- * [新分支] master -> origin/master
- Traceback (most recent call last):
- File "/home/senrsl/test/repo/repo_test/.repo/repo/main.py", line 234, in <module>
- _Main(sys.argv[1:])
- File "/home/senrsl/test/repo/repo_test/.repo/repo/main.py", line 216, in _Main
- repo._Run(argv)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/main.py", line 121, in _Run
- cmd.Execute(copts, cargs)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/subcmds/init.py", line 272, in Execute
- self._SyncManifest(opt)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/subcmds/init.py", line 183, in _SyncManifest
- self._LinkManifest(opt.manifest_name)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/subcmds/init.py", line 198, in _LinkManifest
- self.manifest.Link(name)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 87, in Link
- self.Override(name)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 80, in Override
- self._Load()
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 232, in _Load
- self._ParseManifest(True)
- File "/home/senrsl/test/repo/repo_test/.repo/repo/manifest_xml.py", line 250, in _ParseManifest
- root = xml.dom.minidom.parse(self._manifestFile)
- File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
- return expatbuilder.parse(file)
- File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
- result = builder.parseFile(fp)
- File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
- parser.Parse(buffer, 0)
- xml.parsers.expat.ExpatError: XML declaration not well-formed: line 1, column 19
- senrsl@senrsl-T540p:~/test/repo/repo_test$
又验证了下,repo这个库不需要在mainfest里配
上面那个错,靠,xml 1行19列有错。。。。
2015年11月22日22:32:52
明日
2015年11月23日20:07:49
原来是xml没搞那些空格
然后把xml格式改对,服务器上
本机
- Last login: Mon Nov 23 05:58:04 2015 from 192.168.21.2
- [root@Android ~]# git daemon --export-all --user=dc --group=dc --reuseaddr --base-path=/home/dc /home/dc
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=git://10.5.10.145/repos/repo --no-repo-verify --repo-branch=master -u git://10.5.10.145/repos/manifest.git
- Get git://10.5.10.145/repos/repo
- fatal: unable to connect to 10.5.10.145:
- 10.5.10.145[0: 10.5.10.145]: errno=拒绝连接
- senrsl@senrsl-T540p:~/test/repo/repo_test$ ll
- 总用量 12
- drwxrwxr-x 3 senrsl senrsl 4096 11月 23 20:01 ./
- drwxrwxr-x 10 senrsl senrsl 4096 11月 22 19:13 ../
- drwxrwxr-x 2 senrsl senrsl 4096 11月 23 20:01 .repo/
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=git://10.5.10.145/repos/repo --no-repo-verify --repo-branch=master -u git://10.5.10.145/repos/manifest.git
- Get git://10.5.10.145/repos/repo
- remote: warning: 不能访问 '/root/.config/git/attributes':????
- remote: 对象计数中: 57, 完成.
- remote: 压缩对象中: 100% (54/54), 完成.
- remote: Total 57 (delta 9), reused 0 (delta 0)
- Unpacking objects: 100% (57/57), done.
- 来自 git://10.5.10.145/repos/repo
- * [新分支] master -> origin/master
- Getting manifest ...
- from git://10.5.10.145/repos/manifest.git
- remote: warning: 不能访问 '/root/.config/git/attributes':????
- remote: 对象计数中: 23, 完成.
- remote: 压缩对象中: 100% (17/17), 完成.
- remote: Total 23 (delta 6), reused 0 (delta 0)
- Unpacking objects: 100% (23/23), done.
- 来自 git://10.5.10.145/repos/manifest
- * [新分支] master -> origin/master
- Your Name [senRsl]:
- Your Email [senRsl@163.com]:
- Your identity is: senRsl <senRsl@163.com>
- is this correct [y/n]? y
- repo initialized in /home/senrsl/test/repo/repo_test
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo branch
- (no branches)
- senrsl@senrsl-T540p:~/test/repo/repo_test$ cd .repo/manifests
- senrsl@senrsl-T540p:~/test/repo/repo_test/.repo/manifests$ git branch -a | cut -d / -f 3
- * default
- mastersenrsl@senrsl-T540p:~/test/repo/repo_test/.repo/manifests$ repo sync
- Initializing project pro/pro1 ...
- remote: warning: 不能访问 '/root/.config/git/attributes':????
- remote: 对象计数中: 3, 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- Unpacking objects: 100% (3/3), done.
- 来自 git://10.5.10.145/repos/pro/pro1
- * [新分支] master -> origin/master
- Initializing project pro/pro2 ...
- remote: warning: 不能访问 '/root/.config/git/attributes':????
- remote: 对象计数中: 3, 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- Unpacking objects: 100% (3/3), done.
- 来自 git://10.5.10.145/repos/pro/pro2
- * [新分支] master -> origin/master
- Initializing project pro3 ...
- remote: warning: 不能访问 '/root/.config/git/attributes':????
- remote: 对象计数中: 3, 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- Unpacking objects: 100% (3/3), done.
- 来自 git://10.5.10.145/repos/pro3
- * [新分支] master -> origin/master
- senrsl@senrsl-T540p:~/test/repo/repo_test$ tree
- .
- ├── pro
- │ ├── pro1
- │ │ └── README
- │ └── pro2
- │ └── README
- └── pro3
- └── README
- 4 directories, 3 files
- senrsl@senrsl-T540p:~/test/repo/repo_test$
这样就把库都拉取下来了,就可以按正常的操作走了。。。。
然后,权限配置;脚本;
6.1)关闭防火墙
6.2)权限配置
- #重启后永久关闭
- [root@Android ~]# chkconfig iptables off
- #立即关闭,重启后自动开启
- [root@Android ~]# service iptables stop
- iptables:清除防火墙规则: [确定]
- iptables:将链设置为政策 ACCEPT:filter [确定]
- iptables:正在卸载模块: [确定]
6.3)测试连接
服务器执行
本机执行
- [root@Android ~]# git daemon --export-all --user=git-ro --group=git-ro --reuseaddr --base-path=/home/git-ro /home/git-ro
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=git://10.5.10.145/repos/repo --no-repo-verify --repo-branch=master -u git://10.5.10.145/repos/manifest.git
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo sync
6.4)尝试git-daemon
①软链接
[root@Android ~]# ln -s /usr/local/git/libexec/git-core /usr/libexec/
我屮,我屮,我屮,果然还是要用git-daemon啊
之前不管怎么搞,一直不能访问 '/root/.config/git/attributes':????,改用git-daemon,就没这问题了
②写个脚本:
然后把这个脚本放到
- senrsl@senrsl-T540p:~/test/repo$ cat gitd
- #!/bin/sh
- #
- # Startup/shutdown script for Git Daemon
- # chkconfig: 345 56 10
- #
- # description: Startup/shutdown script for Git Daemon
- #
- . /etc/init.d/functions
- DAEMON=/usr/libexec/git-core/git-daemon
- USER=git-ro
- GROUP=git-ro
- BASE_PATH=/home/git-ro/
- ARGS="--user=$USER --group=$GROUP --detach --base-path=$BASE_PATH --export-all"
- prog=git-daemon
- start () {
- echo -n $"Starting $prog: "
- # start daemon
- daemon $DAEMON $ARGS
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch /var/lock/git-daemon
- return $RETVAL
- }
- stop () {
- # stop daemon
- echo -n $"Stopping $prog: "
- killproc $DAEMON
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && rm -f /var/lock/git-daemon
- }
- restart() {
- stop
- start
- }
- case $1 in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- restart
- ;;
- status)
- status $DAEMON
- RETVAL=$?
- ;;
- *)
- echo $"Usage: $prog {start|stop|restart|status}"
- exit 3
- ;;
- esac
- exit $RETVAL
- senrsl@senrsl-T540p:~/test/repo$
- [root@Android init.d]# cp ~/tools/gitd /etc/init.d/
③脚本权限755
- [root@Android init.d]# chmod 755 gitd
④测试
然后本机
- [root@Android init.d]# service gitd status
- git-daemon 已停
- [root@Android init.d]# service gitd start
- 正在启动 git-daemon: [确定]
- [root@Android init.d]# service gitd status
- git-daemon (pid 1439) 正在运行...
- [root@Android init.d]# service gitd stop
- 停止 git-daemon: [确定]
- [root@Android init.d]# service gitd status
- git-daemon 已停
- [root@Android init.d]# service gitd start
- 正在启动 git-daemon: [确定]
终于不报警告了!!!!!!!
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo init --repo-url=git://10.5.10.145/repos/repo --no-repo-verify --repo-branch=master -u git://10.5.10.145/repos/manifest.git
- Get git://10.5.10.145/repos/repo
- remote: 对象计数中: 57, 完成.
- remote: 压缩对象中: 100% (54/54), 完成.
- remote: Total 57 (delta 9), reused 0 (delta 0)
- 展开对象中: 100% (57/57), 完成.
- 来自 git://10.5.10.145/repos/repo
- * [新分支] master -> origin/master
- Getting manifest ...
- from git://10.5.10.145/repos/manifest.git
- remote: 对象计数中: 23, 完成.
- remote: 压缩对象中: 100% (17/17), 完成.
- remote: Total 23 (delta 6), reused 0 (delta 0)
- 展开对象中: 100% (23/23), 完成.
- 来自 git://10.5.10.145/repos/manifest
- * [新分支] master -> origin/master
- Your Name [senRsl]:
- Your Email [senRsl@163.com]:
- Your identity is: senRsl <senRsl@163.com>
- is this correct [y/n]? y
- repo initialized in /home/senrsl/test/repo/repo_test
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo sync
- Initializing project pro/pro1 ...
- remote: 对象计数中: 3, 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- 展开对象中: 100% (3/3), 完成.
- 来自 git://10.5.10.145/repos/pro/pro1
- * [新分支] master -> origin/master
- Initializing project pro/pro2 ...
- remote: 对象计数中: 3, 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- 展开对象中: 100% (3/3), 完成.
- 来自 git://10.5.10.145/repos/pro/pro2
- * [新分支] master -> origin/master
- Initializing project pro3 ...
- remote: 对象计数中: 3, 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- 展开对象中: 100% (3/3), 完成.
- 来自 git://10.5.10.145/repos/pro3
- * [新分支] master -> origin/master
- senrsl@senrsl-T540p:~/test/repo/repo_test$
以上 读测完了,以下测写
6.5)本地使用测试
①检出分支,编写代码
②修改文件,查看差异
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo branches
- (no branches)
- senrsl@senrsl-T540p:~/test/repo/repo_test$ cd .repo/manifests
- senrsl@senrsl-T540p:~/test/repo/repo_test/.repo/manifests$ git branch -a | cut -d / -f 3
- * default
- master
- senrsl@senrsl-T540p:~/test/repo/repo_test/.repo/manifests$ cd ../..
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo start master --all
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo branches
- * master | in all projects
- senrsl@senrsl-T540p:~/test/repo/repo_test$
对于repo status的说明
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo diff
- project pro3/
- diff --git a/README b/README
- index 9daeafb..3edd806 100644
- --- a/README
- +++ b/README
- @@ -1 +1,3 @@
- test
- +
- +在本机修改文件,提交至服务器
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo diff pro3
- project pro3/
- diff --git a/README b/README
- index 9daeafb..3edd806 100644
- --- a/README
- +++ b/README
- @@ -1 +1,3 @@
- test
- +
- +在本机修改文件,提交至服务器
- senrsl@senrsl-T540p:~/test/repo/repo_test$ repo status
- # on branch master
- project pro3/ branch master
- -m README
- senrsl@senrsl-T540p:~/test/repo/repo_test$
Ø 每个小节的首行显示羡慕名称,以及所在分支的名称③设置远程仓库
Ø 第一个字母表示暂存区的文件修改状态
l -:没有改变
l A:添加(不在HEAD中,在暂存区中)
l M:修改(在HEAD中,在暂存区中,内容不同)
l D:删除(在HEAD中,不在暂存区)
l R:重命名(不在HEAD中,在暂存区,路径修改)
l C:拷贝(不在HEAD中,在暂存区,从其他文件拷贝)
l T:文件状态改变(在HEAD中,在暂存区,内容相同)
l U:未合并,需要冲突解决
Ø 第二个字母表示工作区文件的更改状态
l -:新/未知(不在暂存区,在工作区)
l m:修改(在暂存区,在工作区,被修改)
l d:删除(在暂存区,不在工作区)
Ø 两个表示状态的字母后面,显示文件名信息。如果有文件重名还会显示改变前后的文件名及文件的相似度
地址对应mainfest.xml
senrsl@senrsl-T540p:~/test/repo/repo_test$ repo remote add origin git://10.5.10.145/repos
repo: 'remote' is not a repo command. See 'repo help'.
senrsl@senrsl-T540p:~/test/repo/repo_test$
看来google的这个没有,需要搞个完整版的。。。。
折腾半天,原来repo remote跟repo push都是自己写的。。。。
那样的话就需要给repo添加指令。。。。
④提交代码
坑,看了一遭发现默认的提交需要先提交到代码审核服务器上。。。。
如果不安代码审核服务器,就得需要自己写repo脚本,绕过去。。。。
4,搭建代码审核服务器Gerrit
1)下载
官网是www.gerritcodereview.com,最新版本2.11.5,下载到gerrit 2.11.5.war
2)安装
2.1)创建用户
创建个用户,切换到这个用户下安装
发现竟然没java环境。。。。
- [root@Android gitosis]# useradd -c 'gerrit' -m -d /home/gerrit -s /bin/bash gerrit
- [root@Android gitosis]# passwd gerrit
- 更改用户 gerrit 的密码 。
- 新的 密码:
- 无效的密码: 它基于字典单词
- 重新输入新的 密码:
- passwd: 所有的身份验证令牌已经成功更新。
- [root@Android gitosis]# su gerrit
安java....
2.2)安装JDK
跑oracle下jdk,jdk-8u65-linux-x64.rpm
然后切root,安
然后尝试安装
- [root@Android tools]# rpm -ivh jdk-8u65-linux-x64.rpm
- Preparing... (100########################################### [100%]
- 1:jdk1.8.0_65 ( 1########################################### [100%]
- Unpacking JAR files...
- tools.jar...
- plugin.jar...
- javaws.jar...
- deploy.jar...
- rt.jar...
- jsse.jar...
- charsets.jar...
- localedata.jar...
- jfxrt.jar...
- [root@Android tools]# java -version
- java version "1.8.0_65"
- Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
- Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
2.3)配置mysql服务器
回到另一台服务器上,把mysql开起来,不用H2的数据库了,用mysql
之前的mysql不可以在其他地方登陆,更改下权限就ok
- mysql> select user,password,host from user;
- +------+-------------------------------------------+-----------+
- | user | password | host |
- +------+-------------------------------------------+-----------+
- | root | *FE1C2745E806B636F29EF399A36108BF0BF845CF | localhost |
- | root | | 126 |
- | root | | 127.0.0.1 |
- | | | localhost |
- | | | 126 |
- +------+-------------------------------------------+-----------+
- 5 rows in set (0.00 sec)
- mysql> grant all privileges on *.* to root@'%' identified by '0123' with grant option;
- Query OK, 0 rows affected (0.00 sec)
- mysql> flush privileges;
- Query OK, 0 rows affected (0.00 sec)
然后本机安上navicat,方便操作。
创建用户,创建表
然后,回到版本控制服务器上
- mysql> create user 'gerrit'@'localhost' identified by 'gerrit01';
- Query OK, 0 rows affected (0.00 sec)
- mysql> create database gerritdb;
- Query OK, 1 row affected (0.01 sec)
- mysql> alter database gerritdb charset=latin1;
- Query OK, 1 row affected (0.00 sec)
- mysql> grant all on gerritdb.* to 'gerrit'@'localhost';
- Query OK, 0 rows affected (0.00 sec)
- mysql> flush privileges;
- Query OK, 0 rows affected (0.00 sec)
还后需要配置用户访问库的权限
语法:
- mysql> grant all privileges on gerritdb.* to gerrit@'10.5.10.145' identified by 'gerrit01';
- Query OK, 0 rows affected (0.00 sec)
- mysql> grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by '连接口令';
2.4)安装支持软件
①yum更新源
我屮,手贱了,执行完发现他把系统升级了。。。。。
- [root@Android gerrit]# yum clean all && yum clean metadata && yum clean dbcache && yum makecache && yum update
- [root@Android ~]# cat /etc/redhat-release
- CentOS release 6.7 (Final)
②安装sendmail
- [root@Android ~]# yum install -y sendmail
③安装apache
带有权限的认证,可以用http认证,需要使用反向代理,需要安装apache。。。。
- [root@Android ~]# yum install -y httpd
2.5)安装gerrit
切换用户,安装
终于看到安装成功,但是为什么没有启动。。。。
- [gerrit@Android ~]$ java -jar gerrit-2.11.5.war init -d review
- Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
- [2015-12-08 01:59:06,209] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /home/gerrit/review/etc/gerrit.config; assuming defaults
- *** Gerrit Code Review 2.11.5
- ***
- Create '/home/gerrit/review' [Y/n]?
- *** Git Repositories
- ***
- Location of Git repositories [git]:
- *** SQL Database
- ***
- Database server type [h2]: ?
- Supported options are:
- h2
- jdbc
- maxdb
- mysql
- oracle
- postgresql
- Database server type [h2]: mysql
- Gerrit Code Review is not shipped with MySQL Connector/J 5.1.21
- ** This library is required for your configuration. **
- Download and install it now [Y/n]?
- Downloading http://repo2.maven.org/maven2/mysql/mysql-connector-java/5.1.21/mysql-connector-java-5.1.21.jar ... OK
- Checksum mysql-connector-java-5.1.21.jar OK
- Server hostname [localhost]: 10.5.8.102
- Server port [(mysql default)]:
- Database name [reviewdb]: gerritdb
- Database username [gerrit]:
- gerrit's password :
- confirm password :
- *** Index
- ***
- Type [LUCENE/?]:
- *** User Authentication
- ***
- Authentication method [OPENID/?]: ?
- Supported options are:
- openid
- openid_sso
- http
- http_ldap
- client_ssl_cert_ldap
- ldap
- ldap_bind
- custom_extension
- development_become_any_account
- oauth
- Authentication method [OPENID/?]: http
- Get username from custom HTTP header [y/N]?
- SSO logout URL :
- *** Review Labels
- ***
- Install Verified label [y/N]?
- *** Email Delivery
- ***
- SMTP server hostname [localhost]:
- SMTP server port [(default)]:
- SMTP encryption [NONE/?]:
- SMTP username :
- *** Container Process
- ***
- Run as [gerrit]:
- Java runtime [/usr/java/jdk1.8.0_65/jre]:
- Copy gerrit-2.11.5.war to /home/gerrit/review/bin/gerrit.war [Y/n]?
- Copying gerrit-2.11.5.war to /home/gerrit/review/bin/gerrit.war
- *** SSH Daemon
- ***
- Listen on address [*]:
- Listen on port [29418]:
- Gerrit Code Review is not shipped with Bouncy Castle Crypto SSL v151
- If available, Gerrit can take advantage of features
- in the library, but will also function without it.
- Download and install it now [Y/n]?
- Downloading http://www.bouncycastle.org/download/bcpkix-jdk15on-151.jar ... OK
- Checksum bcpkix-jdk15on-151.jar OK
- Gerrit Code Review is not shipped with Bouncy Castle Crypto Provider v151
- ** This library is required by Bouncy Castle Crypto SSL v151. **
- Download and install it now [Y/n]?
- Downloading http://www.bouncycastle.org/download/bcprov-jdk15on-151.jar ... OK
- Checksum bcprov-jdk15on-151.jar OK
- Generating SSH host key ... rsa... dsa... done
- *** HTTP Daemon
- ***
- Behind reverse proxy [y/N]? y
- Proxy uses SSL (https://) [y/N]? ?
- Proxy uses SSL (https://) [y/N]?
- Subdirectory on proxy server [/]: /gerrit
- Listen on address [*]:
- Listen on port [8081]:
- Canonical URL [http://202.106.199.36/gerrit]: http://10.5.10.145/gerrit
- *** Plugins
- ***
- Installing plugins.
- Install plugin commit-message-length-validator version v2.11.5 [y/N]?
- Install plugin download-commands version v2.11.5 [y/N]?
- Install plugin replication version v2.11.5 [y/N]?
- Install plugin reviewnotes version v2.11.5 [y/N]?
- Install plugin singleusergroup version v2.11.5 [y/N]?
- Initializing plugins.
- No plugins found with init steps.
- fatal: DbInjector failed
- fatal: Unable to determine SqlDialect
- fatal: caused by java.sql.SQLException: Access denied for user 'gerrit'@'10.5.10.145' (using password: YES)
- #找了一遭发现授权的时候把数据库名写错了。。。。
- [gerrit@Android ~]$ java -jar gerrit-2.11.5.war init -d review
- Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
- *** Gerrit Code Review 2.11.5
- ***
- *** Git Repositories
- ***
- Location of Git repositories [git]:
- *** SQL Database
- ***
- Database server type [mysql]:
- Server hostname [10.5.8.102]:
- Server port [(mysql default)]:
- Database name [gerritdb]:
- Database username [gerrit]:
- Change gerrit's password [y/N]?
- *** Index
- ***
- Type [LUCENE/?]:
- The index must be rebuilt before starting Gerrit:
- java -jar gerrit.war reindex -d site_path
- *** User Authentication
- ***
- Authentication method [HTTP/?]:
- Get username from custom HTTP header [y/N]?
- SSO logout URL :
- *** Review Labels
- ***
- Install Verified label [y/N]?
- *** Email Delivery
- ***
- SMTP server hostname [localhost]:
- SMTP server port [(default)]:
- SMTP encryption [NONE/?]:
- SMTP username :
- *** Container Process
- ***
- Run as [gerrit]:
- Java runtime [/usr/java/jdk1.8.0_65/jre]:
- Upgrade /home/gerrit/review/bin/gerrit.war [Y/n]?
- Copying gerrit-2.11.5.war to /home/gerrit/review/bin/gerrit.war
- *** SSH Daemon
- ***
- Listen on address [*]:
- Listen on port [29418]:
- *** HTTP Daemon
- ***
- Behind reverse proxy [Y/n]?
- Proxy uses SSL (https://) [y/N]?
- Subdirectory on proxy server [/gerrit]:
- Listen on address [*]:
- Listen on port [8081]:
- Canonical URL [http://10.5.10.145/gerrit]:
- *** Plugins
- ***
- Installing plugins.
- Install plugin commit-message-length-validator version v2.11.5 [y/N]?
- Install plugin download-commands version v2.11.5 [y/N]?
- Install plugin replication version v2.11.5 [y/N]?
- Install plugin reviewnotes version v2.11.5 [y/N]?
- Install plugin singleusergroup version v2.11.5 [y/N]?
- Initializing plugins.
- No plugins found with init steps.
- Initialized /home/gerrit/review
- [gerrit@Android ~]$
手动启动尝试
查看可知开了俩端口
- [gerrit@Android ~]$ ./review/bin/gerrit.sh start
- Starting Gerrit Code Review: OK
- [gerrit@Android ~]$ netstat -ltpn | grep -i gerrit
- (Not all processes could be identified, non-owned process info
- will not be shown, you would have to be root to see it all.)
- tcp 0 0 :::29418 :::* LISTEN 1509/GerritCodeRevi
- tcp 0 0 :::8081 :::* LISTEN 1509/GerritCodeRevi
设置开机自启
后来发现上面的软链接不管用了,尝试
- [root@Android gerrit]# ln -s /home/gerrit/review/bin/gerrit.sh /etc/init.d/gerrit.sh
- #没切目录,导致后面不能开机自启
- [root@Android gerrit]# chkconfig --level 345 gerrit.sh on
文件
- [root@Android ~]# ln -sf /home/gerrit/review/bin/gerrit.sh /etc/init.d/gerrit
- [root@Android ~]# ln -sf /etc/init.d/gerrit /etc/rc3.d/S90gerrit
- [root@Android ~]# rm /etc/init.d/gerrit.sh
- rm:是否删除符号链接 "/etc/init.d/gerrit.sh"?yes
- [root@Android ~]#
就好了。。。。。
- [root@Android default]# pwd
- /etc/default
- [root@Android default]# touch gerritcodereview
- [root@Android default]# echo 'GERRIT_SITE=/home/gerrit/review'>>gerritcodereview
- [root@Android default]# cat gerritcodereview
- GERRIT_SITE=/home/gerrit/review
- [root@Android default]#
2.6)配置apache反向代理
创建文件夹,创建文件
好吧,实验证明上面放到init.d里根本没加载。。。。
- [root@Android gerrit]# cd /etc/httpd
- [root@Android httpd]# ll
- 总用量 8
- drwxr-xr-x 2 root root 4096 12月 8 01:55 conf
- drwxr-xr-x 2 root root 4096 12月 8 01:55 conf.d
- lrwxrwxrwx 1 root root 19 12月 8 01:55 logs -> ../../var/log/httpd
- lrwxrwxrwx 1 root root 29 12月 8 01:55 modules -> ../../usr/lib64/httpd/modules
- lrwxrwxrwx 1 root root 19 12月 8 01:55 run -> ../../var/run/httpd
- [root@Android httpd]# mkdir init.d
- [root@Android httpd]# cd init.d/
- [root@Android init.d]# touch gerrit.conf
- [root@Android init.d]# vi gerrit.conf
- #写入配置
- #重启服务,配置服务开机自启
- [root@Android init.d]# service httpd restart
- 停止 httpd: [失败]
- 正在启动 httpd: [确定]
- [root@Android init.d]# chkconfig --level 345 httpd on
放到conf.d里就好了
gerrit.conf内容
- [root@Android conf.d]# pwd
- /etc/httpd/conf.d
- [root@Android conf.d]# ll
- 总用量 12
- -rw-r--r-- 1 root root 540 12月 8 19:32 gerrit.conf
- -rw-r--r-- 1 root root 392 8月 25 01:53 README
- -rw-r--r-- 1 root root 299 8月 18 13:57 welcome.conf
- [root@Android conf.d]#
- [root@Android conf.d]# cat gerrit.conf
- <Directory / >
- Options FollowSymLinks
- AllowOverride None
- </Directory>
- SetEnv GIT_PROJECT_ROOT /home/dc/repos/
- SetEnv GIT_HTTP_EXPORT_ALL
- ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
- ServerName localhost
- ProxyRequests Off
- ProxyVia Off
- ProxyPreserveHost On
- <Proxy *>
- Order deny,allow
- Allow from all
- </Proxy>
- <Location "/gerrit/login/">
- AuthType Basic
- AuthName "Gerrit Code Review"
- AuthBasicProvider file
- AuthUserFile /etc/gerrit.passwd
- Require valid-user
- </Location>
- ProxyPass /gerrit http://localhost:8081/gerrit
- [root@Android conf.d]#
上面的配置文件,指定口令文件地址为/etc/gerrit.passwd
2.7)注册gerrit用户
增加用户进上面那个文件
2.8)客户端启动配置
- [root@Android ~]# htpasswd -m /etc/gerrit.passwd dc
- htpasswd: cannot modify file /etc/gerrit.passwd; use '-c' to create it
- [root@Android ~]# htpasswd -c -m /etc/gerrit.passwd dc
- New password:
- Re-type new password:
- Adding password for user dc
- [root@Android ~]#
客户端浏览器连不上
gerrit开机自启有问题;
apache的配置文件代理有问题
2015年12月07日19:27:37
配置文件什么的都配好之后,输入
http://10.5.10.145/gerrit/
会让输入账号密码
然后登陆以后
3)配置gerrit
3.1)登陆后,注册邮箱
点击Register New mail按钮,填入邮件,点击注册。
如果报错什么的,去服务器
把地址粘出来,放入浏览器,注册成功
- [root@Android conf.d]# mailq
- /var/spool/mqueue (1 request)
- -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
- tB8Bd3Ig004648 628 Tue Dec 8 19:39 <gerrit@bt-199-038.bta.net.cn>
- (Deferred: 451 DT:SPM 163 mx6,OMCowEC5oUAzUGZWkLAYAA--.13316S)
- <senRsl@163.com>
- Total requests: 1
- [root@Android conf.d]# ls /var/spool/mqueue/dft*648
- /var/spool/mqueue/dftB8Bd3Ig004648
- [root@Android conf.d]# cat /var/spool/mqueue/dftB8Bd3Ig004648
- Welcome to Gerrit Code Review at 10.5.10.145.
- To add a verified email address to your user account, please
- click on the following link while signed in as dc:
- http://10.5.10.145/gerrit/#/VE/qiF/5rtmv6LbYGBY9842E1ZlqiePc+nDNxxFdQ==$MTpzZW5Sc2xAMTYzLmNvbQ==
- If you have received this mail in error, you do not need to take any
- action to cancel the account. The address will not be activated, and
- you will not receive any further emails.
- If clicking the link above does not work, copy and paste the URL in a
- new browser window instead.
- This is a send-only email address. Replies to this message will not
- be read or answered.
- [root@Android conf.d]#
第一个注册的邮箱有管理员权限,以后注册的用户默认没有管理员权限,权限的修改可由管理员完成。
3.2)新增加管理员
people--ListGroups--Administrators--增加
3.3)添加公钥
跟git的公钥一样
右上角,用户名-Setting--SSH public keys,Add
然后本地
senrsl@senrsl-T540p:~$ cat ~/.ssh/id_rsa.pub
把内容粘上,Add.
3.4)创建新的项目库
一图党
创建这个库的用户默认关注,其他用户可以设置关注这个库
3.5)对库配置单独权限
一图党
上面是评审权限,下面是提交权限
4)检出代码
本机
为什么不用输密码。。。。
- senrsl@senrsl-T540p:~/test/repo/gerrit$ git clone http://10.5.10.145/gerrit/test-gerrit
- 正克隆到 'test-gerrit'...
- remote: Counting objects: 2, done
- remote: Finding sources: 100% (2/2)
- 展开对象中: 100% (2/2), 完成.
- remote: Total 2 (delta 0), reused 0 (delta 0)
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/gerrit$
5)代码提交评审
进入项目,修改,提交
- #记住密码
- senrsl@senrsl-T540p:~/test/repo/gerrit$ git config --global credential.helper store
- senrsl@senrsl-T540p:~/test/repo/gerrit$ cd test-gerrit/
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ ll
- 总用量 12
- drwxrwxr-x 3 senrsl senrsl 4096 12月 8 14:48 ./
- drwxrwxr-x 3 senrsl senrsl 4096 12月 8 14:48 ../
- drwxrwxr-x 8 senrsl senrsl 4096 12月 8 14:48 .git/
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ touch README
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ echo 'test'>>README
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ cat README
- test
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ vi .git/config
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 dc@10.5.10.145:hooks/commit-msg ${gitdir}/hooks/
- The authenticity of host '[10.5.10.145]:29418 ([10.5.10.145]:29418)' can't be established.
- RSA key fingerprint is 35:58:ee:bd:fe:02:4a:d1:e1:20:a0:59:23:df:aa:d7.
- Are you sure you want to continue connecting (yes/no)? yes
- Warning: Permanently added '[10.5.10.145]:29418' (RSA) to the list of known hosts.
- Permission denied (publickey).
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git status
- 位于分支 master
- 您的分支与上游分支 'origin/master' 一致。
- 未跟踪的文件:
- (使用 "git add <文件>..." 以包含要提交的内容)
- README
- 提交为空,但是存在尚未跟踪的文件(使用 "git add" 建立跟踪)
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git add .
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git commit -m 'test'
- [master c7c0bd5] test
- 1 file changed, 1 insertion(+)
- create mode 100644 README
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git push origin HEAD:refs/for/master
- Username for 'http://10.5.10.145': dc
- Password for 'http://dc@10.5.10.145':
- remote: Unauthorized
- fatal: Authentication failed for 'http://10.5.10.145/gerrit/test-gerrit/'
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git push origin HEAD:refs/for/master
- Username for 'http://10.5.10.145': dc
- Password for 'http://dc@10.5.10.145':
- 对象计数中: 3, 完成.
- 写入对象中: 100% (3/3), 234 bytes | 0 bytes/s, 完成.
- Total 3 (delta 0), reused 0 (delta 0)
- remote: Processing changes: refs: 1, done
- remote: ERROR: missing Change-Id in commit message footer
- remote:
- remote: Hint: To automatically insert Change-Id, install the hook:
- remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 dc@10.5.10.145:hooks/commit-msg ${gitdir}/hooks/
- remote: And then amend the commit:
- remote: git commit --amend
- remote:
- To http://10.5.10.145/gerrit/test-gerrit
- ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)
- error: 无法推送一些引用到 'http://10.5.10.145/gerrit/test-gerrit'
- #按上面所说的,还需要加一个说明
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git commit --amend
- [master 0903621] ssssssss shuoming
- Date: Tue Dec 8 14:54:19 2015 +0800
- 1 file changed, 1 insertion(+)
- create mode 100644 README
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git log
- commit 0903621a1182a54686d019e3e64abcab92ee5396
- Author: senRsl <senRsl@163.com>
- Date: Tue Dec 8 14:54:19 2015 +0800
- ssssssss shuoming
- Change-Id: Ifb57da9eeeb817cf2e0a6f87b3e0478462803f1a
- commit 464efb7585dc8cb172187537b49ac9f0c6f142e6
- Author: senRsl <senRsl@163.com>
- Date: Tue Dec 8 22:26:17 2015 +0800
- Initial empty repository
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- 写入对象中: 100% (3/3), 285 bytes | 0 bytes/s, 完成.
- Total 3 (delta 0), reused 0 (delta 0)
- remote: Processing changes: new: 1, refs: 1, done
- remote:
- remote: New Changes:
- remote: http://10.5.10.145/gerrit/1 ssssssss shuoming
- remote:
- To http://10.5.10.145/gerrit/test-gerrit
- * [new branch] HEAD -> refs/for/master
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$
6)评审代码
提交之后据说关注的会收到邮件。。。。
点击
找了一遭,点那个蓝色的试试。。。。
然后点 submit
这个意思看起来是已经合并了啊。。。。
客户端同步代码
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git pull
- 来自 http://10.5.10.145/gerrit/test-gerrit
- 464efb7..0903621 master -> origin/master
- Already up-to-date.
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$
7)中文乱码
客户端
服务器上效果
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ echo '中文'>>README
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ ll
- 总用量 16
- drwxrwxr-x 3 senrsl senrsl 4096 12月 8 14:49 ./
- drwxrwxr-x 3 senrsl senrsl 4096 12月 8 14:48 ../
- drwxrwxr-x 8 senrsl senrsl 4096 12月 8 15:22 .git/
- -rw-rw-r-- 1 senrsl senrsl 12 12月 8 15:25 README
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git commit -am '中文测试'
- [master 4263d13] 中文测试
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- 写入对象中: 100% (3/3), 298 bytes | 0 bytes/s, 完成.
- Total 3 (delta 0), reused 0 (delta 0)
- remote: Processing changes: new: 1, refs: 1, done
- remote:
- remote: New Changes:
- remote: http://10.5.10.145/gerrit/2 中文测试
- remote:
- To http://10.5.10.145/gerrit/test-gerrit
- * [new branch] HEAD -> refs/for/master
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$
列表上中文乱码
进去后中文正常
然后翻一下数据库
7.1)修改数据库为utf-8编码
- mysql> use gerritdb
- No connection. Trying to reconnect...
- Connection id: 914
- Current database: *** NONE ***
- Reading table information for completion of table and column names
- You can turn off this feature to get a quicker startup with -A
- Database changed
- mysql> select subject,original_subject from changes;
- +-------------------+-------------------+
- | subject | original_subject |
- +-------------------+-------------------+
- | ssssssss shuoming | ssssssss shuoming |
- | ???? | ???? |
- | ????2222 | ????2222 |
- +-------------------+-------------------+
- 3 rows in set (0.00 sec)
查看当前:
修改编码
- mysql> show variables like 'character_set%';
- +--------------------------+----------------------------+
- | Variable_name | Value |
- +--------------------------+----------------------------+
- | character_set_client | latin1 |
- | character_set_connection | latin1 |
- | character_set_database | latin1 |
- | character_set_filesystem | binary |
- | character_set_results | latin1 |
- | character_set_server | latin1 |
- | character_set_system | utf8 |
- | character_sets_dir | /usr/share/mysql/charsets/ |
- +--------------------------+----------------------------+
- 8 rows in set (0.01 sec)
然后单个数据库的
- [root@126 etc]# cat /etc/my.cnf
- [client]
- port=3306
- socket=/var/lib/mysql/mysql.sock
- default-character-set=utf8
- [mysqld]
- datadir=/var/lib/mysql
- socket=/var/lib/mysql/mysql.sock
- user=mysql
- # Disabling symbolic-links is recommended to prevent assorted security risks
- symbolic-links=0
- character-set-server=utf8
- #改掉引擎,不然后面会报长度不够
- default-storage-engine=INNODB
- [mysql]
- no-auto-rehash
- default-character-set=utf8
- [mysqld_safe]
- log-error=/var/log/mysqld.log
- pid-file=/var/run/mysqld/mysqld.pid
- [root@126 etc]# service mysqld restart
- Stopping mysqld: [ OK ]
- Starting mysqld: [ OK ]
- [root@126 etc]# mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 7
- Server version: 5.1.73 Source distribution
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> show variables like 'character_set%';
- +--------------------------+----------------------------+
- | Variable_name | Value |
- +--------------------------+----------------------------+
- | character_set_client | utf8 |
- | character_set_connection | utf8 |
- | character_set_database | utf8 |
- | character_set_filesystem | binary |
- | character_set_results | utf8 |
- | character_set_server | utf8 |
- | character_set_system | utf8 |
- | character_sets_dir | /usr/share/mysql/charsets/ |
- +--------------------------+----------------------------+
- 8 rows in set (0.00 sec)
- mysql>
7.2)修改gerrit mysql配置链接
修改链接。。。。
- [root@Android etc]# cat gerrit.config
- [gerrit]
- basePath = git
- canonicalWebUrl = http://10.5.10.145/gerrit
- [database]
- type = mysql
- url = jdbc:mysql://10.5.8.102:3306/gerritdb?user=gerrit&password=gerrit01&useUnicode=true&characterEncoding=utf8
- [index]
- type = LUCENE
- [auth]
- type = HTTP
- [sendemail]
- smtpServer = localhost
- [container]
- user = gerrit
- javaHome = /usr/java/jdk1.8.0_65/jre
- [sshd]
- listenAddress = *:29418
- [httpd]
- listenUrl = proxy-http://*:8081/gerrit
- [cache]
- directory = cache
- [root@Android etc]# cat secure.config
- [auth]
- registerEmailPrivateKey = zplwLw+88VWGm/vtyNWIcEiC7EYJTsEcmDk=
- restTokenPrivateKey = BAFq4jL7577lE8sI6Ta/ouOPP4cWC/OQxAM=
- [root@Android etc]#
7.3)测试
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ echo '中文444测试'>>README
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git commit -am '中文测试444'
- [master 5d6a26e] 中文测试444
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git push origin HEAD:refs/for/master
- 对象计数中: 6, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (3/3), 完成.
- 写入对象中: 100% (6/6), 608 bytes | 0 bytes/s, 完成.
- Total 6 (delta 0), reused 0 (delta 0)
- remote: Processing changes: refs: 2, done
- To http://10.5.10.145/gerrit/test-gerrit
- ! [remote rejected] HEAD -> refs/for/master (internal server error)
- error: 无法推送一些引用到 'http://10.5.10.145/gerrit/test-gerrit'
找日志
说明中文插不进去。。。。
- [root@Android review]# less logs/error_log
- [2015-12-09 01:12:55,016] ERROR com.google.gerrit.server.git.ReceiveCommits : Can't insert change/patchset for test-gerrit
- com.google.gerrit.server.git.InsertException: Error inserting change/patchset
- at com.google.gerrit.server.git.ReceiveCommits$1.apply(ReceiveCommits.java:270)
- at com.google.gerrit.server.git.ReceiveCommits$1.apply(ReceiveCommits.java:261)
- at com.google.common.util.concurrent.Futures$MappingCheckedFuture.mapException(Futures.java:1809)
- at com.google.common.util.concurrent.AbstractCheckedFuture.checkedGet(AbstractCheckedFuture.java:85)
- at com.google.gerrit.server.git.ReceiveCommits.insertChangesAndPatchSets(ReceiveCommits.java:804)
- at com.google.gerrit.server.git.ReceiveCommits.processCommands(ReceiveCommits.java:589)
- at com.google.gerrit.server.git.AsyncReceiveCommits$Worker.run(AsyncReceiveCommits.java:89)
- at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
- at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
- at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
- at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
- at com.google.inject.servlet.ServletScopes$3.call(ServletScopes.java:232)
- at com.google.gerrit.server.util.RequestScopePropagator$1.call(RequestScopePropagator.java:98)
- at com.google.gerrit.server.util.RequestScopePropagator$2.run(RequestScopePropagator.java:131)
- at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
- at java.util.concurrent.FutureTask.run(FutureTask.java:266)
- at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
- at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
- at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:379)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: java.util.concurrent.ExecutionException: com.google.gwtorm.server.OrmException: insert failure on changes
- at java.util.concurrent.FutureTask.report(FutureTask.java:122)
- at java.util.concurrent.FutureTask.get(FutureTask.java:192)
- at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
- at com.google.common.util.concurrent.AbstractCheckedFuture.checkedGet(AbstractCheckedFuture.java:78)
- ... 18 more
- Caused by: com.google.gwtorm.server.OrmException: insert failure on changes
- at com.google.gwtorm.schema.sql.SqlDialect.convertError(SqlDialect.java:158)
- at com.google.gwtorm.schema.sql.DialectMySQL.convertError(DialectMySQL.java:232)
- at com.google.gwtorm.jdbc.JdbcAccess.convertError(JdbcAccess.java:459)
- at com.google.gwtorm.jdbc.JdbcAccess.insert(JdbcAccess.java:170)
- at com.google.gerrit.server.change.ChangeInserter.insert(ChangeInserter.java:210)
- at com.google.gerrit.server.git.ReceiveCommits$CreateRequest.insertChange(ReceiveCommits.java:1724)
- at com.google.gerrit.server.git.ReceiveCommits$CreateRequest.access$900(ReceiveCommits.java:1654)
- at com.google.gerrit.server.git.ReceiveCommits$CreateRequest$1.call(ReceiveCommits.java:1685)
- at com.google.gerrit.server.git.ReceiveCommits$CreateRequest$1.call(ReceiveCommits.java:1681)
- at com.google.gerrit.server.util.RequestScopePropagator$1.call(RequestScopePropagator.java:96)
- at java.util.concurrent.FutureTask.run(FutureTask.java:266)
- at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299)
- at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
- at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58)
- at com.google.gerrit.server.git.ReceiveCommits$CreateRequest.insertChange(ReceiveCommits.java:1680)
- at com.google.gerrit.server.git.ReceiveCommits.insertChangesAndPatchSets(ReceiveCommits.java:800)
- ... 17 more
- Caused by: java.sql.BatchUpdateException: Incorrect string value: '\xE6\x98\xAFis ...' for column 'subject' at row 1
- at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2054)
- at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1467)
- at com.google.gwtorm.schema.sql.SqlDialect.executeBatch(SqlDialect.java:442)
- at com.google.gwtorm.jdbc.JdbcAccess.execute(JdbcAccess.java:449)
- at com.google.gwtorm.jdbc.JdbcAccess.insertAsBatch(JdbcAccess.java:212)
- at com.google.gwtorm.jdbc.JdbcAccess.insert(JdbcAccess.java:165)
- ... 29 more
- Caused by: java.sql.SQLException: Incorrect string value: '\xE6\x98\xAFis ...' for column 'subject' at row 1
- at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
- at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
- at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
- at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
- at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
- at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
- at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
- at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2450)
- at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2006)
- ... 34 more
找了找,发现只把库编码改了,里面的表和列的编码没改。。。。
删了库重建好了,真蛋疼。。。。
- #库编码
- mysql> alter database gerritdb default character set utf8;
- Query OK, 1 row affected (0.00 sec)
- #表和列编码
- mysql> alter table account_diff_preferences convert to character set utf8 collate utf8_general_ci;
- Query OK, 0 rows affected (0.02 sec)
- Records: 0 Duplicates: 0 Warnings: 0
- #每张表都还要跑
我屮删了重建也会出现这个问题
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes
好吧,修改引擎为innodb。。。。。
然后,又重新建库,建项目什么的,重新来了一遍,终于好了。。。。
8)配置git-web
在gerrit的error.log里发现这么一句
[2015-12-09 02:41:05,108] WARN com.google.gerrit.httpd.GitWebConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
挂个链接过去
然后重启gerrit,看后面有了,但是点一片空白
- [root@Android lib]# mkdir cgi-bin
- [root@Android lib]# ll
- 总用量 40
- drwxr-xr-x. 3 root root 4096 11月 21 00:42 anaconda-runtime
- drwxr-xr-x. 3 root root 4096 11月 21 00:42 bonobo
- drwxr-xr-x 2 root root 4096 12月 9 03:13 cgi-bin
- drwxr-xr-x. 5 root root 4096 11月 21 00:42 ConsoleKit
- dr-xr-xr-x. 2 root root 4096 9月 23 2011 games
- drwxr-xr-x 3 root root 4096 11月 22 02:52 gcc
- dr-xr-xr-x. 2 root root 4096 11月 22 01:45 locale
- drwxr-xr-x. 3 root root 4096 7月 24 04:23 python2.6
- drwxr-xr-x. 3 root root 4096 12月 8 01:45 rpm
- lrwxrwxrwx 1 root root 30 12月 8 01:46 sendmail -> /etc/alternatives/mta-sendmail
- lrwxrwxrwx 1 root root 24 12月 8 01:46 sendmail.postfix -> ../sbin/sendmail.postfix
- lrwxrwxrwx 1 root root 25 12月 8 01:34 sendmail.sendmail -> ../sbin/sendmail.sendmail
- drwxr-xr-x. 2 root root 4096 7月 24 18:27 yum-plugins
- [root@Android lib]# cd cgi-bin/
- [root@Android cgi-bin]# ln -s /usr/local/git/share/gitweb/gitweb.cgi /usr/lib/cgi-bin/
- [root@Android cgi-bin]# ll
- 总用量 0
- lrwxrwxrwx 1 root root 38 12月 9 03:15 gitweb.cgi -> /usr/local/git/share/gitweb/gitweb.cgi
好吧,那换个方法试试,把之前那个cgi/bin目录删了,然后
看起来应该是有依赖没安。。。。
- [root@Android gerrit]# ln -s /usr/local/git/share/gitweb/ /usr/local/share/
- [root@Android gerrit]# rm -rf /usr/lib/cgi-bin/
- [root@Android gerrit]# cd /home/gerrit/
- [root@Android gerrit]# cd review/etc/
- [root@Android etc]# vi gerrit.config
- [root@Android etc]# cat gerrit.config
- [gerrit]
- basePath = git
- canonicalWebUrl = http://10.5.10.145/gerrit
- [database]
- type = mysql
- hostname = 10.5.8.102
- database = gerritdb
- username = gerrit
- [index]
- type = LUCENE
- [auth]
- type = HTTP
- [sendemail]
- smtpServer = localhost
- [container]
- user = gerrit
- javaHome = /usr/java/jdk1.8.0_65/jre
- [sshd]
- listenAddress = *:29418
- [httpd]
- listenUrl = proxy-http://*:8081/gerrit
- [cache]
- directory = cache
- [gitweb]
- cgi=/usr/local/share/gitweb/gitweb.cgi
- [root@Android etc]#
然后看error.log
2015年12月08日19:50:45
- [2015-12-09 03:36:16,630] ERROR com.google.gerrit.httpd.gitweb.GitWebServlet : CGI: BEGIN failed--compilation aborted at /usr/local/git/share/gitweb/gitweb.cgi line 13.
- [2015-12-09 03:36:16,631] ERROR com.google.gerrit.httpd.gitweb.GitWebServlet : Non-zero exit status (2) from /usr/local/git/share/gitweb/gitweb.cgi
2015年12月14日17:07:54
服务器变动
10.5.10.145更改为10.1.11.145
10.5.8.102更改为?
之前的好多配置都没了。。。。gerrit都不完全了发现。。。。
to9#
2015年12月21日16:28:08
回来看问题
- [2015-12-22 16:19:54,047] [Gitweb-ErrorLogger] ERROR com.google.gerrit.httpd.gitweb.GitwebServlet : CGI: Can't locate CGI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/git/share/gitweb/gitweb.cgi line 13.
- [2015-12-22 16:19:54,048] [Gitweb-ErrorLogger] ERROR com.google.gerrit.httpd.gitweb.GitwebServlet : CGI: BEGIN failed--compilation aborted at /usr/local/git/share/gitweb/gitweb.cgi line 13.
- [2015-12-22 16:19:54,048] [HTTP-48 - /gerrit/gitweb?p=test-gerrit.git;a=summary] DEBUG org.eclipse.jetty.server.HttpConnection : org.eclipse.jetty.server.HttpConnection$SendCallback@7ff94613[PROCESSING][i=ResponseInfo{HTTP/1.1 200 null,-1,false},cb=org.eclipse.jetty.server.HttpChannel$CommitCallback@7845fa6] generate: NEED_HEADER (null,[p=0,l=0,c=0,r=0],true)@START
应该是环境没装好
百度好久,终于找到了
然后直接再去点项目的gitweb,就能打开了
- [root@Android ~]# yum install -y perl-BerkeleyDB perl-Class-Singleton perl-Convert-BER perl-DateTime perl-DateTime-Format-DateParse perl-DateTime-Locale perl-DateTime-TimeZone perl-DBIx-TableHash perl-List-MoreUtils perl-Net-MAC-Vendor perl-Params-Validate perl-rrdtool perl-SNMP-Multi perl-SNMP-Simple perl-String-CRC32 perl-Unicode-Map perl-XML-DOM perl-XML-RegExp rrdtool perl-XML-Parser perl-Compress-Zlib perl-Time-HiRes perl-CGI
2015年12月22日16:26:50突然发现用一个普通用户登陆,点gitweb显示Not Found....
貌似是没权限
呃,换了IE,直接报404.。。。
查了一遭,好像是个bug.....
然后可以这么解决
增加 refs/meta/config, 就可以访问了,但是这样的话普通用户可以改配置并且发起配置的review。。。。
暂时所有用户都是管理员,看来后面需要把gitweb换掉
看了看android的review,竟然也能edit,提交review。。。。那我就放心了。。。。
然后看了看gerrit的review,他的就没有edit,看来还是要换。。。。
9)中文版gerrit
既然环境没了,那就尝试下搞个中文版的gerrit好了
- senrsl@senrsl-T540p:~/tools/gerrit$ git add .
- senrsl@senrsl-T540p:~/tools/gerrit$ git commit -m 'checkout tag 2 brach : bv2.12-rc2'
- [bv2.12-rc2 0096373] checkout tag 2 brach : bv2.12-rc2
- 1 file changed, 1 insertion(+)
- create mode 100644 README
- senrsl@senrsl-T540p:~/tools/gerrit$ git push origin bv2.12-rc2
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (2/2), 完成.
- 写入对象中: 100% (3/3), 298 bytes | 0 bytes/s, 完成.
- Total 3 (delta 1), reused 0 (delta 0)
- To git@github.com:senRsl/gerrit.git
- * [new branch] bv2.12-rc2 -> bv2.12-rc2
- senrsl@senrsl-T540p:~/tools/gerrit$ git branch
- * bv2.12-rc2
- master
- senrsl@senrsl-T540p:~/tools/gerrit$ ll
- 总用量 260
- drwxrwxr-x 45 senrsl senrsl 4096 12月 14 17:59 ./
- drwxrwxr-x 7 senrsl senrsl 4096 12月 14 17:49 ../
- -rw-rw-r-- 1 senrsl senrsl 1045 12月 14 17:57 BUCK
- -rw-rw-r-- 1 senrsl senrsl 647 12月 14 17:57 .buckconfig
- drwxrwxr-x 2 senrsl senrsl 4096 12月 14 17:50 bucklets/
- -rw-rw-r-- 1 senrsl senrsl 41 12月 14 17:57 .buckversion
- drwxrwxr-x 4 senrsl senrsl 4096 12月 14 17:50 contrib/
- -rw-rw-r-- 1 senrsl senrsl 11358 12月 14 17:50 COPYING
- drwxrwxr-x 3 senrsl senrsl 12288 12月 14 17:57 Documentation/
- -rw-rw-r-- 1 senrsl senrsl 171 12月 14 17:50 .editorconfig
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-acceptance-framework/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-acceptance-tests/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-antlr/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-cache-h2/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-common/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-extension-api/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-gpg/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-gwtdebug/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-gwtexpui/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-gwtui/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-gwtui-common/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-httpd/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-launcher/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-lucene/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-main/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-oauth/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-openid/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-patch-commonsnet/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-patch-jgit/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-pgm/
- drwxrwxr-x 2 senrsl senrsl 4096 12月 14 17:57 gerrit-plugin-api/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-plugin-archetype/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-plugin-gwt-archetype/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-plugin-gwtui/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-plugin-js-archetype/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-prettify/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-reviewdb/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-server/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-sshd/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-util-cli/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-util-http/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 gerrit-util-ssl/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:57 gerrit-war/
- drwxrwxr-x 8 senrsl senrsl 4096 12月 14 18:00 .git/
- -rw-rw-r-- 1 senrsl senrsl 391 12月 14 17:57 .gitignore
- -rw-rw-r-- 1 senrsl senrsl 659 12月 14 17:50 .gitmodules
- -rw-rw-r-- 1 senrsl senrsl 30 12月 14 17:50 INSTALL
- drwxrwxr-x 22 senrsl senrsl 4096 12月 14 17:57 lib/
- -rw-rw-r-- 1 senrsl senrsl 5419 12月 14 17:50 .mailmap
- drwxrwxr-x 8 senrsl senrsl 4096 12月 14 17:57 plugins/
- -rw-rw-r-- 1 senrsl senrsl 302 12月 14 17:50 .pydevproject
- -rw-rw-r-- 1 senrsl senrsl 29 12月 14 17:59 README
- -rw-rw-r-- 1 senrsl senrsl 2693 12月 14 17:50 README.md
- drwxrwxr-x 2 senrsl senrsl 4096 12月 14 17:50 ReleaseNotes/
- drwxrwxr-x 2 senrsl senrsl 4096 12月 14 17:50 .settings/
- -rw-rw-r-- 1 senrsl senrsl 2733 12月 14 17:50 SUBMITTING_PATCHES
- drwxrwxr-x 5 senrsl senrsl 4096 12月 14 17:57 tools/
- -rw-rw-r-- 1 senrsl senrsl 168 12月 14 17:57 VERSION
- -rw-rw-r-- 1 senrsl senrsl 76 12月 14 17:50 .watchmanconfig
- drwxrwxr-x 3 senrsl senrsl 4096 12月 14 17:50 website/
- senrsl@senrsl-T540p:~/tools/gerrit$ buck build release
- 未找到 'buck' 命令,您要输入的是否是:
- 命令 'suck' 来自于包 'suck' (universe)
- buck:未找到命令
- senrsl@senrsl-T540p:~/tools/gerrit$ cd ..
- senrsl@senrsl-T540p:~/tools$ ll
- 总用量 6642072
- drwxrwxr-x 7 senrsl senrsl 4096 12月 14 17:49 ./
- drwxr-xr-x 52 senrsl senrsl 4096 12月 14 10:22 ../
- drwxrwxr-x 4 senrsl senrsl 4096 9月 10 21:24 arm/
- -rw------- 1 senrsl senrsl 4148166656 1月 19 2015 CentOS-7.0-1406-x86_64-DVD.iso
- -rw------- 1 senrsl senrsl 2653276160 10月 13 2011 cn_windows_7_ultimate_with_sp1_x86_dvd_u_677486.iso
- drwxrwxr-x 3 senrsl senrsl 4096 6月 5 2013 dex2jar-0.0.9.15/
- drwxrwxr-x 45 senrsl senrsl 4096 12月 14 17:59 gerrit/
- drwxrwxr-x 8 senrsl senrsl 4096 10月 20 15:40 SoftEtherVPN/
- drwxr-xr-x 7 senrsl senrsl 4096 10月 16 19:20 teamviewer/
- senrsl@senrsl-T540p:~/tools$ git clone https://github.com/facebook/buck.git
- 正克隆到 'buck'...
- remote: Counting objects: 107769, done.
- remote: Total 107769 (delta 0), reused 0 (delta 0), pack-reused 107769
- 接收对象中: 100% (107769/107769), 289.47 MiB | 311.00 KiB/s, 完成.
- 处理 delta 中: 100% (65686/65686), 完成.
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/tools$ cd buck/
- senrsl@senrsl-T540p:~/tools/buck$ ant
- 程序"ant"尚未安装。 您可以使用以下命令安装:
- sudo apt-get install ant
- senrsl@senrsl-T540p:~/tools/buck$ sudo apt-get install ant
- [sudo] password for senrsl:
- 正在读取软件包列表... 完成
- 正在分析软件包的依赖关系树
- 正在读取状态信息... 完成
- 下列软件包是自动安装的并且现在不需要了:
- git-man liberror-perl
- Use 'apt-get autoremove' to remove them.
- 将会安装下列额外的软件包:
- ant-optional libxerces2-java libxml-commons-external-java
- libxml-commons-resolver1.1-java
- 建议安装的软件包:
- ant-doc ant-gcj ant-optional-gcj antlr javacc junit jython libbcel-java
- libbsf-java libcommons-logging-java libcommons-net-java libgnumail-java
- libjaxp1.3-java libjdepend-java libjsch-java liblog4j1.2-java liboro-java
- libregexp-java libxalan2-java libxerces2-java-doc libxerces2-java-gcj
- libxml-commons-resolver1.1-java-doc
- 下列【新】软件包将被安装:
- ant ant-optional libxerces2-java libxml-commons-external-java
- libxml-commons-resolver1.1-java
- 升级了 0 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 213 个软件包未被升级。
- 需要下载 3,869 kB 的软件包。
- 解压缩后会消耗掉 5,210 kB 的额外空间。
- 您希望继续执行吗? [Y/n] Y
- 获取:1 http://archive.ubuntu.com/ubuntu/ trusty/main libxml-commons-resolver1.1-java all 1.2-7build1 [91.6 kB]
- 获取:2 http://archive.ubuntu.com/ubuntu/ trusty/main libxml-commons-external-java all 1.4.01-2build1 [245 kB]
- 获取:3 http://archive.ubuntu.com/ubuntu/ trusty/main libxerces2-java all 2.11.0-7 [1,362 kB]
- 获取:4 http://archive.ubuntu.com/ubuntu/ trusty/main ant all 1.9.3-2build1 [1,869 kB]
- 获取:5 http://archive.ubuntu.com/ubuntu/ trusty/main ant-optional all 1.9.3-2build1 [302 kB]
- 下载 3,869 kB,耗时 21秒 (183 kB/s)
- 正在选中未选择的软件包 libxml-commons-resolver1.1-java。
- (正在读取数据库 ... 系统当前共安装有 215739 个文件和目录。)
- 正准备解包 .../libxml-commons-resolver1.1-java_1.2-7build1_all.deb ...
- 正在解包 libxml-commons-resolver1.1-java (1.2-7build1) ...
- 正在选中未选择的软件包 libxml-commons-external-java。
- 正准备解包 .../libxml-commons-external-java_1.4.01-2build1_all.deb ...
- 正在解包 libxml-commons-external-java (1.4.01-2build1) ...
- 正在选中未选择的软件包 libxerces2-java。
- 正准备解包 .../libxerces2-java_2.11.0-7_all.deb ...
- 正在解包 libxerces2-java (2.11.0-7) ...
- 正在选中未选择的软件包 ant。
- 正准备解包 .../ant_1.9.3-2build1_all.deb ...
- 正在解包 ant (1.9.3-2build1) ...
- 正在选中未选择的软件包 ant-optional。
- 正准备解包 .../ant-optional_1.9.3-2build1_all.deb ...
- 正在解包 ant-optional (1.9.3-2build1) ...
- 正在处理用于 man-db (2.6.7.1-1ubuntu1) 的触发器 ...
- 正在设置 libxml-commons-resolver1.1-java (1.2-7build1) ...
- 正在设置 libxml-commons-external-java (1.4.01-2build1) ...
- 正在设置 libxerces2-java (2.11.0-7) ...
- 正在设置 ant (1.9.3-2build1) ...
- 正在设置 ant-optional (1.9.3-2build1) ...
- senrsl@senrsl-T540p:~/tools/buck$ ant
- Buildfile: /home/senrsl/tools/buck/build.xml
- checkversion:
- BUILD FAILED
- /home/senrsl/tools/buck/build.xml:179: Require JDK 7 or higher
- Total time: 0 seconds
- senrsl@senrsl-T540p:~/tools/buck$ source ~/.bashrc
- senrsl@senrsl-T540p:~/tools/buck$ ant
- Buildfile: /home/senrsl/tools/buck/build.xml
- checkversion:
- compile-testrunner:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/testrunner/classes
- [javac] Compiling 13 source files to /home/senrsl/tools/buck/build/testrunner/classes
- compile-aosp:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/aosp/classes
- [javac] Compiling 17 source files to /home/senrsl/tools/buck/build/aosp/classes
- [javac] [compiled 5594 lines in 930 ms: 6015.0 lines/s]
- [javac] [34 .class files generated]
- tracing-api:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/tracing-api/classes
- [javac] Compiling 2 source files to /home/senrsl/tools/buck/build/tracing-api/classes
- [javac] [compiled 150 lines in 291 ms: 515.4 lines/s]
- [javac] [2 .class files generated]
- [jar] Building jar: /home/senrsl/tools/buck/build/tracing-api/tracing-api.jar
- bootstrapper:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/bootstrapper/classes
- [javac] Compiling 8 source files to /home/senrsl/tools/buck/build/bootstrapper/classes
- [javac] [compiled 341 lines in 333 ms: 1024.0 lines/s]
- [javac] [8 .class files generated]
- [jar] Building jar: /home/senrsl/tools/buck/build/bootstrapper/bootstrapper.jar
- package-resources:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/classes/com/facebook/buck/cli/quickstart/android
- [zip] Building zip: /home/senrsl/tools/buck/build/classes/com/facebook/buck/cli/quickstart/android/android-template.zip
- [mkdir] Created dir: /home/senrsl/tools/buck/build/classes/com/facebook/buck/cli/quickstart/ios
- [zip] Building zip: /home/senrsl/tools/buck/build/classes/com/facebook/buck/cli/quickstart/ios/ios-template.zip
- dx-check-build:
- dx:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/dx_classes
- [javac] Compiling 385 source files to /home/senrsl/tools/buck/build/dx_classes
- [javac] 注: 某些输入文件使用了未经检查或不安全的操作。
- [javac] 注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
- [javac] Creating empty /home/senrsl/tools/buck/build/dx_classes/com/android/dx/rop/package-info.class
- [javac] Creating empty /home/senrsl/tools/buck/build/dx_classes/com/android/dx/ssa/package-info.class
- [jar] Building jar: /home/senrsl/tools/buck/build/dx.jar
- check-immutables:
- generate-immutables:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/immutables
- [javac] Compiling 90 source files
- compile:
- [copy] Copying 1 file to /home/senrsl/tools/buck/build/classes/com/facebook/buck/json
- [javac] Compiling 1329 source files to /home/senrsl/tools/buck/build/classes
- [javac] [compiled 219689 lines in 6229 ms: 35268.7 lines/s]
- [javac] [2591 .class files generated]
- javac-tracing:
- [mkdir] Created dir: /home/senrsl/tools/buck/build/javac-tracing/classes
- [javac] Compiling 3 source files to /home/senrsl/tools/buck/build/javac-tracing/classes
- [javac] [compiled 253 lines in 276 ms: 916.6 lines/s]
- [javac] [4 .class files generated]
- [jar] Building jar: /home/senrsl/tools/buck/build/javac-tracing/javac-tracing-compiler-plugin.jar
- [copy] Copying 1 file to /home/senrsl/tools/buck/build/classes/com/facebook/buck/jvm/java/tracing
- report-generator-jar:
- [jar] Building jar: /home/senrsl/tools/buck/build/report-generator.jar
- default:
- BUILD SUCCESSFUL
- Total time: 19 seconds
- senrsl@senrsl-T540p:~/tools/buck$ ./bin/buck --help
- Buck does not appear to have been built -- building Buck!
- All done, continuing with build.
- Not using buckd because watchman isn't installed.
- buck build tool
- usage:
- buck [options]
- buck command --help
- buck command [command-options]
- available commands:
- audit lists the inputs for the specified target
- build builds the specified target
- cache makes calls to the artifact cache
- clean deletes any generated files
- fetch downloads remote resources to your local machine
- install builds and installs an application
- project generates project configuration files for an IDE
- publish builds and publishes a library to a central repository
- query provides facilities to query information about the target nodes graph
- quickstart generates a default project directory
- run runs a target as a command
- server query and control the http server
- simulate timed simulation of a build without running the steps
- targets prints the list of buildable targets
- test builds and runs the tests for the specified target
- uninstall uninstalls an APK
- options:
- --help : Shows this screen and exits.
- --version (-V) : Show version number.
- senrsl@senrsl-T540p:~/tools/buck$
下gerrit源码,发现编译需要buck,看了下这是facebook封装了以下ant,多线程编译
然后安buck,发现也需要从源码开搞,然后下载,发现需要ant编译
然后安ant,编译
然后编译好后去编gerrit
毛。。。。
- senrsl@senrsl-T540p:~/tools/gerrit$ ~/tools/buck/bin/buck build release
- Buck is at d451e7185efa38ca7118f294606869418d505f2a, but should be 1b03b4313b91b634bd604fc3487a05f877e59dee.
- Buck is updating itself. To disable this, add a '.nobuckcheck'
- file to your project root. In general, you should only disable
- this if you are developing Buck.
- Buck does not appear to have been built -- building Buck!
- All done, continuing with build.
- Not using buckd because watchman isn't installed.
- No Android platform target specified. Using default: Google Inc.:Google APIs:21
- [-] PROCESSING BUCK FILES...FINISHED 1.6s [100%]
- [+] BUILDING...1.5s [28%] (6/772 JOBS, 5 UPDATED, 0.6% CACHE MISS)
- |=> IDLE
- |=> IDLE
- |=> IDLE
- |=> IDLE
- |=> IDLE
- |=> IDLE
- |=> IDLE
- |=> IDLE
- |=> IDLE
- |=> IDLE
- BUILD FAILED: Google APIs not found in /home/senrsl/android/android-sdk-linux/add-ons/addon-google_apis-google-21/libs.
- Please run '/home/senrsl/android/android-sdk-linux/tools/android sdk' and select both 'SDK Platform' and 'Google APIs' under Android (API 21)
- senrsl@senrsl-T540p:~/tools/gerrit$
安watchman,watchman也需要从源码安。。。。
需要先安automak
然后下watchman源码,编译安装
- senrsl@senrsl-T540p:~/tools/gerrit$ sudo apt-get install automake
- senrsl@senrsl-T540p:~/tools$ git clone https://github.com/facebook/watchman.git
- senrsl@senrsl-T540p:~/tools$ cd watchman/
- senrsl@senrsl-T540p:~/tools/watchman$ ./autogen.sh
- senrsl@senrsl-T540p:~/tools/watchman$ ./configure
- senrsl@senrsl-T540p:~/tools/watchman$ make
- #报错 pywatchman/bser.c:31:20: fatal error: Python.h: 没有那个文件或目录
- senrsl@senrsl-T540p:~/tools/watchman$ sudo apt-get install python-dev
- senrsl@senrsl-T540p:~/tools/watchman$ make clean
- senrsl@senrsl-T540p:~/tools/watchman$ make
- senrsl@senrsl-T540p:~/tools/watchman$ sudo make install
- senrsl@senrsl-T540p:~/tools/watchman$ watchman --version
- 4.3.0
- senrsl@senrsl-T540p:~/tools/watchman$
然后解决后面,android api 版本小于21。。。。
没找到在哪配置版本,那就下个21吧
- senrsl@senrsl-T540p:~$ cd android/android-sdk-linux/tools/
- senrsl@senrsl-T540p:~/android/android-sdk-linux/tools$ android sdk
编了半天
各种报错
我屮,闹心好久
- senrsl@senrsl-T540p:~/tools$ git clone --recursive https://gerrit.googlesource.com/gerrit
- 正克隆到 'gerrit'...
- remote: Sending approximately 52.40 MiB ...
- remote: Counting objects: 161, done
- remote: Finding sources: 100% (161/161)
- remote: Total 236358 (delta 122568), reused 236358 (delta 122568)
- 接收对象中: 100% (236358/236358), 52.40 MiB | 101.00 KiB/s, 完成.
- 处理 delta 中: 100% (122589/122589), 完成.
- 检查连接... 完成。
- 子模组 'plugins/commit-message-length-validator' (https://gerrit.googlesource.com/plugins/commit-message-length- validator) 未对路径 'plugins/commit-message-length-validator' 注册
- 子模组 'plugins/cookbook-plugin' (https://gerrit.googlesource.com/plugins/cookbook-plugin) 未对路径 'plugins/cookbook-plugin' 注册
- 子模组 'plugins/download-commands' (https://gerrit.googlesource.com/plugins/download-commands) 未对路径 'plugins/download-commands' 注册
- 子模组 'plugins/replication' (https://gerrit.googlesource.com/plugins/replication) 未对路径 'plugins/replication' 注册
- 子模组 'plugins/reviewnotes' (https://gerrit.googlesource.com/plugins/reviewnotes) 未对路径 'plugins/reviewnotes' 注册
- 子模组 'plugins/singleusergroup' (https://gerrit.googlesource.com/plugins/singleusergroup) 未对路径 'plugins/singleusergroup' 注册
- 正克隆到 'plugins/commit-message-length-validator'...
- remote: Counting objects: 47, done
- remote: Finding sources: 100% (47/47)
- remote: Total 251 (delta 20), reused 251 (delta 20)
- 接收对象中: 100% (251/251), 53.74 KiB | 0 bytes/s, 完成.
- 处理 delta 中: 100% (20/20), 完成.
- 检查连接... 完成。
- 子模组路径 'plugins/commit-message-length-validator':检出 '8d295ed48e8f52eef5661b6eb10d6402d197c776'
- 正克隆到 'plugins/cookbook-plugin'...
- remote: Counting objects: 42, done
- remote: Finding sources: 100% (42/42)
- remote: Total 1360 (delta 210), reused 1360 (delta 210)
- 接收对象中: 100% (1360/1360), 273.82 KiB | 133.00 KiB/s, 完成.
- 处理 delta 中: 100% (210/210), 完成.
- 检查连接... 完成。
- 子模组路径 'plugins/cookbook-plugin':检出 'eea84e7e07ecf6ebb70ea5a6b0cde67f5a5576af'
- 正克隆到 'plugins/download-commands'...
- remote: Counting objects: 43, done
- remote: Finding sources: 100% (43/43)
- remote: Total 511 (delta 56), reused 511 (delta 56)
- 接收对象中: 100% (511/511), 106.65 KiB | 0 bytes/s, 完成.
- 处理 delta 中: 100% (56/56), 完成.
- 检查连接... 完成。
- 子模组路径 'plugins/download-commands':检出 '87075138f5b27e9aba91a3af56ddcf1cda3be6b1'
- 正克隆到 'plugins/replication'...
- remote: Counting objects: 50, done
- remote: Finding sources: 100% (50/50)
- remote: Total 1812 (delta 333), reused 1812 (delta 333)
- 接收对象中: 100% (1812/1812), 658.72 KiB | 121.00 KiB/s, 完成.
- 处理 delta 中: 100% (333/333), 完成.
- 检查连接... 完成。
- 子模组路径 'plugins/replication':检出 '4ab29b755a147a69d88bf000e276a7a2eaa6403b'
- 正克隆到 'plugins/reviewnotes'...
- remote: Counting objects: 47, done
- remote: Finding sources: 100% (47/47)
- remote: Total 509 (delta 37), reused 509 (delta 37)
- 接收对象中: 100% (509/509), 161.57 KiB | 210.00 KiB/s, 完成.
- 处理 delta 中: 100% (37/37), 完成.
- 检查连接... 完成。
- 子模组路径 'plugins/reviewnotes':检出 '26f38c4514687c388472be19c9789eaa84b1d564'
- 正克隆到 'plugins/singleusergroup'...
- remote: Counting objects: 30, done
- remote: Finding sources: 100% (30/30)
- remote: Total 124 (delta 11), reused 124 (delta 11)
- 接收对象中: 100% (124/124), 35.74 KiB | 0 bytes/s, 完成.
- 处理 delta 中: 100% (11/11), 完成.
- 检查连接... 完成。
- 子模组路径 'plugins/singleusergroup':检出 'f6df7121d2704e73c2a315a660e5cc4e12ab1ab9'
- senrsl@senrsl-T540p:~/tools$ ll
- 总用量 6642080
- drwxrwxr-x 9 senrsl senrsl 4096 12月 15 15:46 ./
- drwxr-xr-x 53 senrsl senrsl 4096 12月 15 13:45 ../
- drwxrwxr-x 4 senrsl senrsl 4096 9月 10 21:24 arm/
- drwxrwxr-x 18 senrsl senrsl 4096 12月 15 15:25 buck/
- -rw------- 1 senrsl senrsl 4148166656 1月 19 2015 CentOS-7.0-1406-x86_64-DVD.iso
- -rw------- 1 senrsl senrsl 2653276160 10月 13 2011 cn_windows_7_ultimate_with_sp1_x86_dvd_u_677486.iso
- drwxrwxr-x 3 senrsl senrsl 4096 6月 5 2013 dex2jar-0.0.9.15/
- drwxrwxr-x 46 senrsl senrsl 4096 12月 15 15:56 gerrit/
- drwxrwxr-x 8 senrsl senrsl 4096 10月 20 15:40 SoftEtherVPN/
- drwxr-xr-x 7 senrsl senrsl 4096 10月 16 19:20 teamviewer/
- drwxrwxr-x 17 senrsl senrsl 4096 12月 15 13:58 watchman/
- senrsl@senrsl-T540p:~/tools$ cd gerrit/
- senrsl@senrsl-T540p:~/tools/gerrit$ buck build release
- Using watchman.
- No Android platform target specified. Using default: Google Inc.:Google APIs:21
- [-] PROCESSING BUCK FILES...FINISHED 2.0s [100%]
- [+] BUILDING...6.8s [28%] (415/879 JOBS, 415 UPDATED, 2.0% CACHE MISS)
- |=> //lib/js:iron-resizable-behavior__download_bower... 4.7s (running genrule)
- |=> //lib/js:promise-polyfill__download_bower... 4.5s (running genrule[4.5s])
- |=> //lib/js:web-animations-js__download_bower... 4.7s (running genrule[4.7s])
- |=> //gerrit-gwtui-common:client#abi... 0.1s (checking local cache)
- |=> //lib/js:font-roboto__download_bower... 4.6s (running genrule[4.6s])
- |=> //lib/js:paper-styles__download_bower... 4.8s (running genrule[4.7s])
- |=> //lib/js:iron-fit-behavior__download_bower... 4.8s (running genrule[4.7s])
- |=> //lib/gwt:dev... 4.4s (running calculate_abi[4.3s])
- |=> //lib/js:neon-animation__download_bower... 1.5s (running genrule[1.5s])
- |=> //lib/js:iron-ajax__download_bower... 4.3s (running genrule[4.3s])
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'web-animations/web-animations-js#2.1.2']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'web-animations/web-animations-js#2.1.2']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerelements/paper-styles#1.0.13']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerelements/paper-styles#1.0.13']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerelements/font-roboto#1.0.1']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerelements/font-roboto#1.0.1']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerelements/iron-overlay-behavior#1.1.1']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerelements/iron-overlay-behavior#1.1.1']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerelements/iron-resizable-behavior#1.0.2']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerelements/iron-resizable-behavior#1.0.2']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerlabs/promise-polyfill#1.0.0']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerlabs/promise-polyfill#1.0.0']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerelements/iron-fit-behavior#1.0.5']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerelements/iron-fit-behavior#1.0.5']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerelements/iron-ajax#1.1.0']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerelements/iron-ajax#1.1.0']
- /usr/bin/env: node: ���������������������������
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/run_npm_binary.py", line 91, in <module>
- File "tools/js/run_npm_binary.py", line 87, in main
- File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
- raise CalledProcessError(retcode, cmd)
- CalledProcessError: Command '['/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5-59d457122a161e42cc1625bbab8179c214b7ac11/package/bin/bower', '-l=error', '-j', 'info', 'polymerelements/neon-animation#1.0.8']' returned non-zero exit status 127
- Traceback (most recent call last):
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
- self.execute_entry(entry_point, args)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
- runner(entry_point)
- File "/home/senrsl/tools/gerrit/buck-out/gen/tools/js/download_bower.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
- runpy.run_module(module_name, run_name='__main__')
- File "/usr/lib/python2.7/runpy.py", line 180, in run_module
- fname, loader, pkg_name)
- File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
- exec code in run_globals
- File "tools/js/download_bower.py", line 121, in <module>
- File "tools/js/download_bower.py", line 92, in main
- File "tools/js/download_bower.py", line 46, in bower_info
- OSError: Command failed: ['/home/senrsl/tools/gerrit/buck-out/gen/tools/js/run_npm_binary.pex', '/home/senrsl/tools/gerrit/buck-out/gen/lib/js/bower/bower@1.6.5.npm_binary.tgz', '-l=error', '-j', 'info', 'polymerelements/neon-animation#1.0.8']
- senrsl@senrsl-T540p:~/tools/gerrit$
然后
竟然编译完成了。。。。
- senrsl@senrsl-T540p:~/tools/gerrit$ sudo apt-get install npm
- [sudo] password for senrsl:
- 正在读取软件包列表... 完成
- 正在分析软件包的依赖关系树
- 正在读取状态信息... 完成
- 下列软件包是自动安装的并且现在不需要了:
- git-man liberror-perl
- Use 'apt-get autoremove' to remove them.
- 将会安装下列额外的软件包:
- gyp javascript-common libc-ares-dev libc-ares2 libjs-node-uuid
- libv8-3.14-dev libv8-3.14.5 node-abbrev node-ansi node-archy node-async
- node-block-stream node-combined-stream node-cookie-jar node-delayed-stream
- node-forever-agent node-form-data node-fstream node-fstream-ignore
- node-github-url-from-git node-glob node-graceful-fs node-gyp node-inherits
- node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime
- node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
- node-normalize-package-data node-npmlog node-once node-osenv node-qs
- node-read node-read-package-json node-request node-retry node-rimraf
- node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
- node-which nodejs nodejs-dev
- 建议安装的软件包:
- apache2 lighttpd httpd node-hawk node-aws-sign node-oauth-sign
- node-http-signature
- 下列【新】软件包将被安装:
- gyp javascript-common libc-ares-dev libc-ares2 libjs-node-uuid
- libv8-3.14-dev libv8-3.14.5 node-abbrev node-ansi node-archy node-async
- node-block-stream node-combined-stream node-cookie-jar node-delayed-stream
- node-forever-agent node-form-data node-fstream node-fstream-ignore
- node-github-url-from-git node-glob node-graceful-fs node-gyp node-inherits
- node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime
- node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
- node-normalize-package-data node-npmlog node-once node-osenv node-qs
- node-read node-read-package-json node-request node-retry node-rimraf
- node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
- node-which nodejs nodejs-dev npm
- 升级了 0 个软件包,新安装了 54 个软件包,要卸载 0 个软件包,有 213 个软件包未被升级。
- 需要下载 3,241 kB 的软件包。
- 解压缩后会消耗掉 14.1 MB 的额外空间。
- 您希望继续执行吗? [Y/n] Y
- 获取:1 http://archive.ubuntu.com/ubuntu/ trusty/main libc-ares2 amd64 1.10.0-2 [38.5 kB]
- 获取:2 http://archive.ubuntu.com/ubuntu/ trusty/universe gyp all 0.1~svn1729-3ubuntu1 [201 kB]
- 获取:3 http://archive.ubuntu.com/ubuntu/ trusty/main javascript-common all 11 [6,066 B]
- 获取:4 http://archive.ubuntu.com/ubuntu/ trusty/universe libjs-node-uuid all 1.4.0-1 [11.1 kB]
- 获取:5 http://archive.ubuntu.com/ubuntu/ trusty/universe libv8-3.14.5 amd64 3.14.5.8-5ubuntu2 [1,189 kB]
- 获取:6 http://archive.ubuntu.com/ubuntu/ trusty/universe libv8-3.14-dev amd64 3.14.5.8-5ubuntu2 [57.6 kB]
- 获取:7 http://archive.ubuntu.com/ubuntu/ trusty/universe nodejs amd64 0.10.25~dfsg2-2ubuntu1 [684 kB]
- 获取:8 http://archive.ubuntu.com/ubuntu/ trusty/universe node-async all 0.2.5-1 [17.7 kB]
- 获取:9 http://archive.ubuntu.com/ubuntu/ trusty/universe node-node-uuid all 1.4.0-1 [2,530 B]
- 获取:10 http://archive.ubuntu.com/ubuntu/ trusty/main libc-ares-dev amd64 1.10.0-2 [109 kB]
- 获取:11 http://archive.ubuntu.com/ubuntu/ trusty/universe node-abbrev all 1.0.4-2 [3,814 B]
- 获取:12 http://archive.ubuntu.com/ubuntu/ trusty/universe node-ansi all 0.2.1-1 [8,692 B]
- 获取:13 http://archive.ubuntu.com/ubuntu/ trusty/universe node-archy all 0.0.2-1 [3,660 B]
- 获取:14 http://archive.ubuntu.com/ubuntu/ trusty/universe node-inherits all 2.0.0-1 [3,090 B]
- 获取:15 http://archive.ubuntu.com/ubuntu/ trusty/universe node-block-stream all 0.0.7-1 [4,832 B]
- 获取:16 http://archive.ubuntu.com/ubuntu/ trusty/universe node-delayed-stream all 0.0.5-1 [4,750 B]
- 获取:17 http://archive.ubuntu.com/ubuntu/ trusty/universe node-combined-stream all 0.0.4-1 [4,686 B]
- 获取:18 http://archive.ubuntu.com/ubuntu/ trusty/universe node-cookie-jar all 0.3.1-1 [3,746 B]
- 获取:19 http://archive.ubuntu.com/ubuntu/ trusty/universe node-forever-agent all 0.5.1-1 [3,194 B]
- 获取:20 http://archive.ubuntu.com/ubuntu/ trusty/universe node-mime all 1.2.11-1 [20.2 kB]
- 获取:21 http://archive.ubuntu.com/ubuntu/ trusty/universe node-form-data all 0.1.0-1 [6,412 B]
- 获取:22 http://archive.ubuntu.com/ubuntu/ trusty/universe node-rimraf all 2.2.2-2 [5,392 B]
- 获取:23 http://archive.ubuntu.com/ubuntu/ trusty/universe node-mkdirp all 0.3.5-1 [4,146 B]
- 获取:24 http://archive.ubuntu.com/ubuntu/ trusty/universe node-graceful-fs all 2.0.0-2 [6,718 B]
- 获取:25 http://archive.ubuntu.com/ubuntu/ trusty/universe node-fstream all 0.1.24-1 [19.5 kB]
- 获取:26 http://archive.ubuntu.com/ubuntu/ trusty/universe node-lru-cache all 2.3.1-1 [5,674 B]
- 获取:27 http://archive.ubuntu.com/ubuntu/ trusty/universe node-sigmund all 1.0.0-1 [3,818 B]
- 获取:28 http://archive.ubuntu.com/ubuntu/ trusty/universe node-minimatch all 0.2.12-1 [14.9 kB]
- 获取:29 http://archive.ubuntu.com/ubuntu/ trusty/universe node-fstream-ignore all 0.0.6-2 [5,586 B]
- 获取:30 http://archive.ubuntu.com/ubuntu/ trusty/universe node-github-url-from-git all 1.1.1-1 [3,138 B]
- 获取:31 http://archive.ubuntu.com/ubuntu/ trusty/universe node-glob all 3.2.6-1 [13.7 kB]
- 获取:32 http://archive.ubuntu.com/ubuntu/ trusty/universe nodejs-dev amd64 0.10.25~dfsg2-2ubuntu1 [169 kB]
- 获取:33 http://archive.ubuntu.com/ubuntu/ trusty/universe node-nopt all 2.1.2-1 [11.8 kB]
- 获取:34 http://archive.ubuntu.com/ubuntu/ trusty/universe node-npmlog all 0.0.4-1 [5,844 B]
- 获取:35 http://archive.ubuntu.com/ubuntu/ trusty/universe node-osenv all 0.0.3-1 [3,810 B]
- 获取:36 http://archive.ubuntu.com/ubuntu/ trusty/universe node-tunnel-agent all 0.3.1-1 [4,018 B]
- 获取:37 http://archive.ubuntu.com/ubuntu/ trusty/universe node-json-stringify-safe all 5.0.0-1 [3,544 B]
- 获取:38 http://archive.ubuntu.com/ubuntu/ trusty/universe node-qs all 0.6.5-1 [5,876 B]
- 获取:39 http://archive.ubuntu.com/ubuntu/ trusty/universe node-request all 2.26.1-1 [14.5 kB]
- 获取:40 http://archive.ubuntu.com/ubuntu/ trusty/universe node-semver all 2.1.0-2 [16.2 kB]
- 获取:41 http://archive.ubuntu.com/ubuntu/ trusty/universe node-tar all 0.1.18-1 [18.3 kB]
- 获取:42 http://archive.ubuntu.com/ubuntu/ trusty/universe node-which all 1.0.5-2 [3,678 B]
- 获取:43 http://archive.ubuntu.com/ubuntu/ trusty/universe node-gyp all 0.10.10-2 [22.6 kB]
- 获取:44 http://archive.ubuntu.com/ubuntu/ trusty/universe node-ini all 1.1.0-1 [4,770 B]
- 获取:45 http://archive.ubuntu.com/ubuntu/ trusty/universe node-lockfile all 0.4.1-1 [5,450 B]
- 获取:46 http://archive.ubuntu.com/ubuntu/ trusty/universe node-mute-stream all 0.0.3-1 [3,738 B]
- 获取:47 http://archive.ubuntu.com/ubuntu/ trusty/universe node-normalize-package-data all 0.2.2-1 [9,286 B]
- 获取:48 http://archive.ubuntu.com/ubuntu/ trusty/universe node-once all 1.1.1-1 [2,608 B]
- 获取:49 http://archive.ubuntu.com/ubuntu/ trusty/universe node-read all 1.0.4-1 [4,282 B]
- 获取:50 http://archive.ubuntu.com/ubuntu/ trusty/universe node-read-package-json all 1.1.3-1 [7,762 B]
- 获取:51 http://archive.ubuntu.com/ubuntu/ trusty/universe node-retry all 0.6.0-1 [6,172 B]
- 获取:52 http://archive.ubuntu.com/ubuntu/ trusty/universe node-sha all 1.2.3-1 [4,272 B]
- 获取:53 http://archive.ubuntu.com/ubuntu/ trusty/universe node-slide all 1.1.4-1 [6,118 B]
- 获取:54 http://archive.ubuntu.com/ubuntu/ trusty/universe npm all 1.3.10~dfsg-1 [442 kB]
- 下载 3,241 kB,耗时 42秒 (75.7 kB/s)
- 正在从软件包中解出模板:100%
- 正在选中未选择的软件包 libc-ares2:amd64。
- (正在读取数据库 ... 系统当前共安装有 216392 个文件和目录。)
- 正准备解包 .../libc-ares2_1.10.0-2_amd64.deb ...
- 正在解包 libc-ares2:amd64 (1.10.0-2) ...
- 正在选中未选择的软件包 gyp。
- 正准备解包 .../gyp_0.1~svn1729-3ubuntu1_all.deb ...
- 正在解包 gyp (0.1~svn1729-3ubuntu1) ...
- 正在选中未选择的软件包 javascript-common。
- 正准备解包 .../javascript-common_11_all.deb ...
- 正在解包 javascript-common (11) ...
- 正在选中未选择的软件包 libjs-node-uuid。
- 正准备解包 .../libjs-node-uuid_1.4.0-1_all.deb ...
- 正在解包 libjs-node-uuid (1.4.0-1) ...
- 正在选中未选择的软件包 libv8-3.14.5。
- 正准备解包 .../libv8-3.14.5_3.14.5.8-5ubuntu2_amd64.deb ...
- 正在解包 libv8-3.14.5 (3.14.5.8-5ubuntu2) ...
- 正在选中未选择的软件包 libv8-3.14-dev。
- 正准备解包 .../libv8-3.14-dev_3.14.5.8-5ubuntu2_amd64.deb ...
- 正在解包 libv8-3.14-dev (3.14.5.8-5ubuntu2) ...
- 正在选中未选择的软件包 nodejs。
- 正准备解包 .../nodejs_0.10.25~dfsg2-2ubuntu1_amd64.deb ...
- 正在解包 nodejs (0.10.25~dfsg2-2ubuntu1) ...
- 正在选中未选择的软件包 node-async。
- 正准备解包 .../node-async_0.2.5-1_all.deb ...
- 正在解包 node-async (0.2.5-1) ...
- 正在选中未选择的软件包 node-node-uuid。
- 正准备解包 .../node-node-uuid_1.4.0-1_all.deb ...
- 正在解包 node-node-uuid (1.4.0-1) ...
- 正在选中未选择的软件包 libc-ares-dev:amd64。
- 正准备解包 .../libc-ares-dev_1.10.0-2_amd64.deb ...
- 正在解包 libc-ares-dev:amd64 (1.10.0-2) ...
- 正在选中未选择的软件包 node-abbrev。
- 正准备解包 .../node-abbrev_1.0.4-2_all.deb ...
- 正在解包 node-abbrev (1.0.4-2) ...
- 正在选中未选择的软件包 node-ansi。
- 正准备解包 .../node-ansi_0.2.1-1_all.deb ...
- 正在解包 node-ansi (0.2.1-1) ...
- 正在选中未选择的软件包 node-archy。
- 正准备解包 .../node-archy_0.0.2-1_all.deb ...
- 正在解包 node-archy (0.0.2-1) ...
- 正在选中未选择的软件包 node-inherits。
- 正准备解包 .../node-inherits_2.0.0-1_all.deb ...
- 正在解包 node-inherits (2.0.0-1) ...
- 正在选中未选择的软件包 node-block-stream。
- 正准备解包 .../node-block-stream_0.0.7-1_all.deb ...
- 正在解包 node-block-stream (0.0.7-1) ...
- 正在选中未选择的软件包 node-delayed-stream。
- 正准备解包 .../node-delayed-stream_0.0.5-1_all.deb ...
- 正在解包 node-delayed-stream (0.0.5-1) ...
- 正在选中未选择的软件包 node-combined-stream。
- 正准备解包 .../node-combined-stream_0.0.4-1_all.deb ...
- 正在解包 node-combined-stream (0.0.4-1) ...
- 正在选中未选择的软件包 node-cookie-jar。
- 正准备解包 .../node-cookie-jar_0.3.1-1_all.deb ...
- 正在解包 node-cookie-jar (0.3.1-1) ...
- 正在选中未选择的软件包 node-forever-agent。
- 正准备解包 .../node-forever-agent_0.5.1-1_all.deb ...
- 正在解包 node-forever-agent (0.5.1-1) ...
- 正在选中未选择的软件包 node-mime。
- 正准备解包 .../node-mime_1.2.11-1_all.deb ...
- 正在解包 node-mime (1.2.11-1) ...
- 正在选中未选择的软件包 node-form-data。
- 正准备解包 .../node-form-data_0.1.0-1_all.deb ...
- 正在解包 node-form-data (0.1.0-1) ...
- 正在选中未选择的软件包 node-rimraf。
- 正准备解包 .../node-rimraf_2.2.2-2_all.deb ...
- 正在解包 node-rimraf (2.2.2-2) ...
- 正在选中未选择的软件包 node-mkdirp。
- 正准备解包 .../node-mkdirp_0.3.5-1_all.deb ...
- 正在解包 node-mkdirp (0.3.5-1) ...
- 正在选中未选择的软件包 node-graceful-fs。
- 正准备解包 .../node-graceful-fs_2.0.0-2_all.deb ...
- 正在解包 node-graceful-fs (2.0.0-2) ...
- 正在选中未选择的软件包 node-fstream。
- 正准备解包 .../node-fstream_0.1.24-1_all.deb ...
- 正在解包 node-fstream (0.1.24-1) ...
- 正在选中未选择的软件包 node-lru-cache。
- 正准备解包 .../node-lru-cache_2.3.1-1_all.deb ...
- 正在解包 node-lru-cache (2.3.1-1) ...
- 正在选中未选择的软件包 node-sigmund。
- 正准备解包 .../node-sigmund_1.0.0-1_all.deb ...
- 正在解包 node-sigmund (1.0.0-1) ...
- 正在选中未选择的软件包 node-minimatch。
- 正准备解包 .../node-minimatch_0.2.12-1_all.deb ...
- 正在解包 node-minimatch (0.2.12-1) ...
- 正在选中未选择的软件包 node-fstream-ignore。
- 正准备解包 .../node-fstream-ignore_0.0.6-2_all.deb ...
- 正在解包 node-fstream-ignore (0.0.6-2) ...
- 正在选中未选择的软件包 node-github-url-from-git。
- 正准备解包 .../node-github-url-from-git_1.1.1-1_all.deb ...
- 正在解包 node-github-url-from-git (1.1.1-1) ...
- 正在选中未选择的软件包 node-glob。
- 正准备解包 .../node-glob_3.2.6-1_all.deb ...
- 正在解包 node-glob (3.2.6-1) ...
- 正在选中未选择的软件包 nodejs-dev。
- 正准备解包 .../nodejs-dev_0.10.25~dfsg2-2ubuntu1_amd64.deb ...
- 正在解包 nodejs-dev (0.10.25~dfsg2-2ubuntu1) ...
- 正在选中未选择的软件包 node-nopt。
- 正准备解包 .../node-nopt_2.1.2-1_all.deb ...
- 正在解包 node-nopt (2.1.2-1) ...
- 正在选中未选择的软件包 node-npmlog。
- 正准备解包 .../node-npmlog_0.0.4-1_all.deb ...
- 正在解包 node-npmlog (0.0.4-1) ...
- 正在选中未选择的软件包 node-osenv。
- 正准备解包 .../node-osenv_0.0.3-1_all.deb ...
- 正在解包 node-osenv (0.0.3-1) ...
- 正在选中未选择的软件包 node-tunnel-agent。
- 正准备解包 .../node-tunnel-agent_0.3.1-1_all.deb ...
- 正在解包 node-tunnel-agent (0.3.1-1) ...
- 正在选中未选择的软件包 node-json-stringify-safe。
- 正准备解包 .../node-json-stringify-safe_5.0.0-1_all.deb ...
- 正在解包 node-json-stringify-safe (5.0.0-1) ...
- 正在选中未选择的软件包 node-qs。
- 正准备解包 .../node-qs_0.6.5-1_all.deb ...
- 正在解包 node-qs (0.6.5-1) ...
- 正在选中未选择的软件包 node-request。
- 正准备解包 .../node-request_2.26.1-1_all.deb ...
- 正在解包 node-request (2.26.1-1) ...
- 正在选中未选择的软件包 node-semver。
- 正准备解包 .../node-semver_2.1.0-2_all.deb ...
- 正在解包 node-semver (2.1.0-2) ...
- 正在选中未选择的软件包 node-tar。
- 正准备解包 .../node-tar_0.1.18-1_all.deb ...
- 正在解包 node-tar (0.1.18-1) ...
- 正在选中未选择的软件包 node-which。
- 正准备解包 .../node-which_1.0.5-2_all.deb ...
- 正在解包 node-which (1.0.5-2) ...
- 正在选中未选择的软件包 node-gyp。
- 正准备解包 .../node-gyp_0.10.10-2_all.deb ...
- 正在解包 node-gyp (0.10.10-2) ...
- 正在选中未选择的软件包 node-ini。
- 正准备解包 .../node-ini_1.1.0-1_all.deb ...
- 正在解包 node-ini (1.1.0-1) ...
- 正在选中未选择的软件包 node-lockfile。
- 正准备解包 .../node-lockfile_0.4.1-1_all.deb ...
- 正在解包 node-lockfile (0.4.1-1) ...
- 正在选中未选择的软件包 node-mute-stream。
- 正准备解包 .../node-mute-stream_0.0.3-1_all.deb ...
- 正在解包 node-mute-stream (0.0.3-1) ...
- 正在选中未选择的软件包 node-normalize-package-data。
- 正准备解包 .../node-normalize-package-data_0.2.2-1_all.deb ...
- 正在解包 node-normalize-package-data (0.2.2-1) ...
- 正在选中未选择的软件包 node-once。
- 正准备解包 .../node-once_1.1.1-1_all.deb ...
- 正在解包 node-once (1.1.1-1) ...
- 正在选中未选择的软件包 node-read。
- 正准备解包 .../node-read_1.0.4-1_all.deb ...
- 正在解包 node-read (1.0.4-1) ...
- 正在选中未选择的软件包 node-read-package-json。
- 正准备解包 .../node-read-package-json_1.1.3-1_all.deb ...
- 正在解包 node-read-package-json (1.1.3-1) ...
- 正在选中未选择的软件包 node-retry。
- 正准备解包 .../node-retry_0.6.0-1_all.deb ...
- 正在解包 node-retry (0.6.0-1) ...
- 正在选中未选择的软件包 node-sha。
- 正准备解包 .../node-sha_1.2.3-1_all.deb ...
- 正在解包 node-sha (1.2.3-1) ...
- 正在选中未选择的软件包 node-slide。
- 正准备解包 .../node-slide_1.1.4-1_all.deb ...
- 正在解包 node-slide (1.1.4-1) ...
- 正在选中未选择的软件包 npm。
- 正准备解包 .../npm_1.3.10~dfsg-1_all.deb ...
- 正在解包 npm (1.3.10~dfsg-1) ...
- 正在处理用于 man-db (2.6.7.1-1ubuntu1) 的触发器 ...
- 正在处理用于 doc-base (0.10.5) 的触发器 ...
- Processing 5 added doc-base files...
- 正在设置 libc-ares2:amd64 (1.10.0-2) ...
- 正在设置 gyp (0.1~svn1729-3ubuntu1) ...
- 正在设置 javascript-common (11) ...
- 正在设置 libjs-node-uuid (1.4.0-1) ...
- 正在设置 libv8-3.14.5 (3.14.5.8-5ubuntu2) ...
- 正在设置 libv8-3.14-dev (3.14.5.8-5ubuntu2) ...
- 正在设置 nodejs (0.10.25~dfsg2-2ubuntu1) ...
- update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in 自动模式
- 正在设置 node-async (0.2.5-1) ...
- 正在设置 node-node-uuid (1.4.0-1) ...
- 正在设置 libc-ares-dev:amd64 (1.10.0-2) ...
- 正在设置 node-abbrev (1.0.4-2) ...
- 正在设置 node-ansi (0.2.1-1) ...
- 正在设置 node-archy (0.0.2-1) ...
- 正在设置 node-inherits (2.0.0-1) ...
- 正在设置 node-block-stream (0.0.7-1) ...
- 正在设置 node-delayed-stream (0.0.5-1) ...
- 正在设置 node-combined-stream (0.0.4-1) ...
- 正在设置 node-cookie-jar (0.3.1-1) ...
- 正在设置 node-forever-agent (0.5.1-1) ...
- 正在设置 node-mime (1.2.11-1) ...
- 正在设置 node-form-data (0.1.0-1) ...
- 正在设置 node-rimraf (2.2.2-2) ...
- 正在设置 node-mkdirp (0.3.5-1) ...
- 正在设置 node-graceful-fs (2.0.0-2) ...
- 正在设置 node-fstream (0.1.24-1) ...
- 正在设置 node-lru-cache (2.3.1-1) ...
- 正在设置 node-sigmund (1.0.0-1) ...
- 正在设置 node-minimatch (0.2.12-1) ...
- 正在设置 node-fstream-ignore (0.0.6-2) ...
- 正在设置 node-github-url-from-git (1.1.1-1) ...
- 正在设置 node-glob (3.2.6-1) ...
- 正在设置 nodejs-dev (0.10.25~dfsg2-2ubuntu1) ...
- 正在设置 node-nopt (2.1.2-1) ...
- 正在设置 node-npmlog (0.0.4-1) ...
- 正在设置 node-osenv (0.0.3-1) ...
- 正在设置 node-tunnel-agent (0.3.1-1) ...
- 正在设置 node-json-stringify-safe (5.0.0-1) ...
- 正在设置 node-qs (0.6.5-1) ...
- 正在设置 node-request (2.26.1-1) ...
- 正在设置 node-semver (2.1.0-2) ...
- 正在设置 node-tar (0.1.18-1) ...
- 正在设置 node-which (1.0.5-2) ...
- 正在设置 node-gyp (0.10.10-2) ...
- 正在设置 node-ini (1.1.0-1) ...
- 正在设置 node-lockfile (0.4.1-1) ...
- 正在设置 node-mute-stream (0.0.3-1) ...
- 正在设置 node-normalize-package-data (0.2.2-1) ...
- 正在设置 node-once (1.1.1-1) ...
- 正在设置 node-read (1.0.4-1) ...
- 正在设置 node-read-package-json (1.1.3-1) ...
- 正在设置 node-retry (0.6.0-1) ...
- 正在设置 node-sha (1.2.3-1) ...
- 正在设置 node-slide (1.1.4-1) ...
- 正在设置 npm (1.3.10~dfsg-1) ...
- 正在处理用于 libc-bin (2.19-0ubuntu6.6) 的触发器 ...
- senrsl@senrsl-T540p:~/tools/gerrit$ npm -v
- 1.3.10
- senrsl@senrsl-T540p:~/tools/gerrit$ buck clean
- Shutting down nailgun server...
- Using watchman.
- senrsl@senrsl-T540p:~/tools/gerrit$ buck build release
- No Android platform target specified. Using default: Google Inc.:Google APIs:21
- No Android platform target specified. Using default: Google Inc.:Google APIs:21
- No Android platform target specified. Using default: Google Inc.:Google APIs:21
- [+] PROCESSING BUCK FILES...0.3s [100%]
- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
- SLF4J: Defaulting to no-operation (NOP) logger implementation
- SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
- [-] PROCESSING BUCK FILES...FINISHED 1.8s [100%]
- [-] BUILDING...FINISHED 86.0s [100%] (466/879 JOBS, 466 UPDATED, 10.5% CACHE MI)
- senrsl@senrsl-T540p:~/tools/gerrit$
结果生成于
看起来应该是使用了缓存,第二次clean,build秒编完成
- /home/senrsl/tools/gerrit/buck-out/gen/release/release.war
- senrsl@senrsl-T540p:~/tools/gerrit$ buck clean
- Shutting down nailgun server...
- Using watchman.
- senrsl@senrsl-T540p:~/tools/gerrit$ buck build release
- [-] PROCESSING BUCK FILES...FINISHED 1.8s [100%]
- [-] BUILDING...FINISHED 1.5s [100%] (1/879 JOBS, 1 UPDATED, 0.0% CACHE MISS)
- senrsl@senrsl-T540p:~/tools/gerrit$
然后各种改.properties,改完编译运行
看起来还不错哈
中文版搞定!
10)服务器搬迁
搬完发现gerrit不完整了。。。。好吧,重装
用自己编的中文版的
自己编的中文版比之前那个版本高,会自动升级数据库
- [gerrit@Android ~]$ java -jar release.war init -d review
- Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
- [2015-12-19 00:05:49,571] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /home/gerrit/review/etc/gerrit.config; assuming defaults
- *** Gerrit Code Review 2.12-rc2-380-g70f9ae2-dirty
- ***
- Create '/home/gerrit/review' [Y/n]?
- *** Git Repositories
- ***
- Location of Git repositories [git]:
- *** SQL Database
- ***
- Database server type [h2]: mysql
- Gerrit Code Review is not shipped with MySQL Connector/J 5.1.21
- ** This library is required for your configuration. **
- Download and install it now [Y/n]?
- Downloading http://repo2.maven.org/maven2/mysql/mysql-connector-java/5.1.21/mysql-connector-java-5.1.21.jar ... OK
- Checksum mysql-connector-java-5.1.21.jar OK
- Server hostname [localhost]: 10.1.8.102
- Server port [(mysql default)]:
- Database name [reviewdb]: gerritdb
- Database username [gerrit]:
- gerrit's password :
- confirm password :
- *** Index
- ***
- Type [LUCENE/?]:
- *** User Authentication
- ***
- Authentication method [OPENID/?]: http
- Get username from custom HTTP header [y/N]?
- SSO logout URL :
- Enable signed push support [y/N]?
- *** Review Labels
- ***
- Install Verified label [y/N]?
- *** Email Delivery
- ***
- SMTP server hostname [localhost]:
- SMTP server port [(default)]:
- SMTP encryption [NONE/?]:
- SMTP username :
- *** Container Process
- ***
- Run as [gerrit]:
- Java runtime [/usr/java/jdk1.8.0_65/jre]:
- Copy release.war to review/bin/gerrit.war [Y/n]?
- Copying release.war to review/bin/gerrit.war
- *** SSH Daemon
- ***
- Listen on address [*]:
- Listen on port [29418]:
- Gerrit Code Review is not shipped with Bouncy Castle Crypto SSL v152
- If available, Gerrit can take advantage of features
- in the library, but will also function without it.
- Download and install it now [Y/n]?
- Downloading http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar ... OK
- Checksum bcpkix-jdk15on-152.jar OK
- Gerrit Code Review is not shipped with Bouncy Castle Crypto Provider v152
- ** This library is required by Bouncy Castle Crypto SSL v152. **
- Download and install it now [Y/n]?
- Downloading http://www.bouncycastle.org/download/bcprov-jdk15on-152.jar ... OK
- Checksum bcprov-jdk15on-152.jar OK
- Generating SSH host key ... rsa... dsa... done
- *** HTTP Daemon
- ***
- Behind reverse proxy [y/N]? y
- Proxy uses SSL (https://) [y/N]?
- Subdirectory on proxy server [/]: /gerrit
- Listen on address [*]:
- Listen on port [8081]:
- Canonical URL [http://bt-199-037.bta.net.cn/gerrit]: http://10.1.11.145/gerrit
- *** Plugins
- ***
- Installing plugins.
- Install plugin commit-message-length-validator version v2.12-rc2 [y/N]?
- Install plugin download-commands version v2.12-rc2 [y/N]?
- Install plugin singleusergroup version v2.12-rc2 [y/N]?
- Install plugin replication version v2.12-rc2-5-g4ab29b7 [y/N]?
- Install plugin reviewnotes version v2.12-rc2 [y/N]?
- Initializing plugins.
- No plugins found with init steps.
- Upgrading schema to 108 ...
- Upgrading schema to 109 ...
- Upgrading schema to 110 ...
- Upgrading schema to 111 ...
- Upgrading schema to 112 ...
- Upgrading schema to 113 ...
- Upgrading schema to 114 ...
- Upgrading schema to 115 ...
- Upgrading schema to 116 ...
- Migrating data to schema 108 ...
- Listing all changes ...
- done
- Updating groups for open changes ...
- done
- Migrating data to schema 109 ...
- Migrating data to schema 110 ...
- Migrating data to schema 111 ...
- Migrating data to schema 112 ...
- Migrating data to schema 113 ...
- Migrating data to schema 114 ...
- Migrating data to schema 115 ...
- Migrating data to schema 116 ...
- Migrate user preference copySelfOnEmail to emailStrategy
- Execute the following SQL to drop unused objects:
- DROP TABLE account_diff_preferences;
- DROP TABLE patch_set_ancestors;
- ALTER TABLE accounts DROP COLUMN contact_filed_on;
- ALTER TABLE accounts DROP COLUMN copy_self_on_email;
- Execute now [Y/n]?
- Initialized /home/gerrit/review
- Executing /home/gerrit/review/bin/gerrit.sh start
- Starting Gerrit Code Review: OK
- Waiting for server on 10.1.11.145:80 ... OK
- Opening http://10.1.11.145/gerrit/#/admin/projects/ ...FAILED
- Open Gerrit with a JavaScript capable browser:
- http://10.1.11.145/gerrit/#/admin/projects/
- [gerrit@Android ~]$
升级之后发现本地的git下的库都没了,报找不到,好吧,还是重装。。。。
重装之后发现发送验证邮件有问题。
然后尝试
重装sendmail,
安装mail,
配置邮件发送为163的smtp
- [root@Android ~]# yum remove sendmail
- [root@Android ~]# yum install -y sendmail
- [root@Android ~]# yum install mail
- [root@Android ~]# which mail
- /bin/mail
- [root@Android ~]# tail -n 2 /etc/mail.rc
- set from=senrsl01@163.com smtp=smtp.163.com
- set smtp-auth-user=senrsl01@163.com smtp-auth-password=ovcnkhecycjgzkaw smtp-auth=login
- [root@Android ~]# echo test | mail -s test senrsl01@163.com
- [gerrit@Android etc]$ cat gerrit.config
- [gerrit]
- basePath = git
- canonicalWebUrl = http://10.1.11.145/gerrit
- [database]
- type = mysql
- hostname = 10.1.8.102
- database = gerritdb
- username = gerrit
- [index]
- type = LUCENE
- [auth]
- type = HTTP
- [receive]
- enableSignedPush = false
- [sendemail]
- smtpServer = smtp.163.com
- smtpServerPort = 465
- smtpEncryption = SSL
- smtpUser = senRsl01@163.com
- from = senRsl01@163.com
- [container]
- user = gerrit
- javaHome = /usr/java/jdk1.8.0_65/jre
- [sshd]
- listenAddress = *:29418
- [httpd]
- listenUrl = proxy-http://*:8081/gerrit
- [cache]
- directory = cache
- [gerrit@Android etc]$
第一个发送test成功
第二个发送注册验证报错
查看代码
- com.google.gerrit.server.account.CreateEmail : Cannot send email verification message to senRsl@126.com
- com.google.gerrit.common.errors.EmailException: Mail Error: Server smtp.163.com rejected message body: 554 DT:SPM 163 smtp2,DNGowEDZmU_1bndWvfIQAA--.859S2 1450667769,please see http://mail.163.com/help/help_spam_16.htm?ip=61.50.103.158&hostid=smtp2&time=1450667769
. 554 DT:SPM 发送的邮件内容包含了未被许可的信息,或被系统识别为垃圾邮件。请检查是否有用户发送病毒或者垃圾邮件;
。。。。
改成公司的邮箱就好了。。。。
邮件模板位置在:
- senrsl@senrsl-T540p:~/tools/gerrit$ ls gerrit-server/src/main/resources/com/google/gerrit/server/mail/
- Abandoned.vm CommentFooter.vm MergeFail.vm ReplacePatchSet.vm
- AddKey.vm Comment.vm NewChange.vm Restored.vm
- ChangeFooter.vm Footer.vm old Reverted.vm
- ChangeSubject.vm Merged.vm RegisterNewEmail.vm
- senrsl@senrsl-T540p:~/tools/gerrit$
可以改中文,
改完,编译,删掉之前的那些重装好了
- [gerrit@Android ~]$ java -jar release.war init -d review
- log4j:WARN No such property [target] in org.apache.log4j.DailyRollingFileAppender.
- log4j:WARN File option not set for appender [stdout].
- log4j:WARN Are you using FileAppender instead of ConsoleAppender?
- log4j:ERROR Either File or DatePattern options are not set for appender [stdout].
- Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
- [2015-12-21 22:07:24,258] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /home/gerrit/review/etc/gerrit.config; assuming defaults
- log4j:ERROR No output stream or file set for the appender named [stdout].
- *** Gerrit Code Review 2.12-rc2-381-g31c519d-dirty
- ***
- Create '/home/gerrit/review' [Y/n]?
- *** Git Repositories
- ***
- Location of Git repositories [git]:
- *** SQL Database
- ***
- Database server type [h2]: mysql
- Gerrit Code Review is not shipped with MySQL Connector/J 5.1.21
- ** This library is required for your configuration. **
- Download and install it now [Y/n]?
- Downloading http://repo2.maven.org/maven2/mysql/mysql-connector-java/5.1.21/mysql-connector-java-5.1.21.jar ... OK
- Checksum mysql-connector-java-5.1.21.jar OK
- Server hostname [localhost]: 10.1.8.102
- Server port [(mysql default)]:
- Database name [reviewdb]: gerritdb
- Database username [gerrit]:
- gerrit's password :
- confirm password :
- *** Index
- ***
- Type [LUCENE/?]:
- *** User Authentication
- ***
- Authentication method [OPENID/?]: http
- Get username from custom HTTP header [y/N]?
- SSO logout URL : http://10.1.11.145
- Enable signed push support [y/N]?
- *** Review Labels
- ***
- Install Verified label [y/N]?
- *** Email Delivery
- ***
- SMTP server hostname [localhost]: smtp.126.com
- SMTP server port [(default)]: 25
- SMTP encryption [NONE/?]:
- SMTP username [gerrit]: senRsl@126.com
- senRsl@126.com's password :
- confirm password :
- *** Container Process
- ***
- Run as [gerrit]:
- Java runtime [/usr/java/jdk1.8.0_65/jre]:
- Copy release.war to review/bin/gerrit.war [Y/n]?
- Copying release.war to review/bin/gerrit.war
- *** SSH Daemon
- ***
- Listen on address [*]:
- Listen on port [29418]:
- Gerrit Code Review is not shipped with Bouncy Castle Crypto SSL v152
- If available, Gerrit can take advantage of features
- in the library, but will also function without it.
- Download and install it now [Y/n]?
- Downloading http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar ... OK
- Checksum bcpkix-jdk15on-152.jar OK
- Gerrit Code Review is not shipped with Bouncy Castle Crypto Provider v152
- ** This library is required by Bouncy Castle Crypto SSL v152. **
- Download and install it now [Y/n]?
- Downloading http://www.bouncycastle.org/download/bcprov-jdk15on-152.jar ... OK
- Checksum bcprov-jdk15on-152.jar OK
- Generating SSH host key ... rsa... dsa... done
- *** HTTP Daemon
- ***
- Behind reverse proxy [y/N]? y
- Proxy uses SSL (https://) [y/N]?
- Subdirectory on proxy server [/]: /gerrit
- Listen on address [*]:
- Listen on port [8081]:
- Canonical URL [http://bt-199-037.bta.net.cn/gerrit]: http://10.1.11.145/gerrit
- *** Plugins
- ***
- Installing plugins.
- Install plugin commit-message-length-validator version v2.12-rc2 [y/N]?
- Install plugin download-commands version v2.12-rc2 [y/N]?
- Install plugin singleusergroup version v2.12-rc2 [y/N]?
- Install plugin replication version v2.12-rc2-5-g4ab29b7 [y/N]?
- Install plugin reviewnotes version v2.12-rc2 [y/N]?
- Initializing plugins.
- No plugins found with init steps.
- fatal: CInitialized /home/gerrit/review
- Executing /home/gerrit/review/bin/gerrit.sh start
- Starting Gerrit Code Review: OK
- Waiting for server on 10.1.11.145:80 ... OK
- Opening http://10.1.11.145/gerrit/#/admin/projects/ ...FAILED
- Open Gerrit with a JavaScript capable browser:
- http://10.1.11.145/gerrit/#/admin/projects/
- [gerrit@Android ~]$
发现发邮件竟然使用的默认的
改掉
等打起来了找运维给弄个专门的邮箱。。。。
- [gerrit@Android review]$ cat etc/gerrit.config
- [gerrit]
- basePath = git
- canonicalWebUrl = http://10.1.11.145/gerrit
- [database]
- type = mysql
- hostname = 10.1.8.102
- database = gerritdb
- username = gerrit
- [index]
- type = LUCENE
- [auth]
- type = HTTP
- logoutUrl = http://10.1.11.145
- [receive]
- enableSignedPush = false
- [sendemail]
- smtpServer = smtp.126.com
- smtpServerPort = 25
- smtpUser = senRsl@126.com
- from = gerrit@126.com
- [container]
- user = gerrit
- javaHome = /usr/java/jdk1.8.0_65/jre
- [sshd]
- listenAddress = *:29418
- [httpd]
- listenUrl = proxy-http://*:8081/gerrit
- [cache]
- directory = cache
- [gerrit@Android review]$
新建个账户
Last login: Mon Dec 21 21:45:11 2015 from 192.168.6.5
[root@Android ~]# htpasswd -m /etc/gerrit.passwd senRsl
New password:
Re-type new password:
Adding password for user senRsl
[root@Android ~]#
然后登陆,注册邮件
竟然显示代发。。。。
好吧,还是把from改回本尊,不要代发,到时候直接找运维新开个好了
然后新建测试项目,修改代码,提交评审。。。。
直接按上面的跑就好
然后加这个的时候折腾了一会
这是因为没有把SSH配上,配上就好了。
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- Permission denied (publickey).
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- commit-msg 100% 4678 4.6KB/s 00:00
- senrsl@senrsl-T540p:~/test/repo/gerrit/test-gerrit$ git status
为什么不显示 git clone那个地址。。。。。。。
呃。。。。。之前就搞到这儿。回#8去搞git-web
终于把拖欠了俩月的工资结了。。。。
11)gerrit删除项目
- [root@Android gerrit]# service gerrit stop
- Stopping Gerrit Code Review: OK
- [gerrit@Android git]$ rm -rf test01.git
- [root@Android gerrit]# service gerrit start
- Starting Gerrit Code Review: OK
- [root@Android gerrit]#
关闭服务,然后到项目库路径下删除文件夹,启动服务。。。。
示例为test01.git
12)SSH命令访问gerrit
senrsl@senrsl-T540p:~/test/repo/kernel-android-common$ ssh -p 29418 zym@10.1.11.145
**** 欢迎使用代码审核服务 ****
Hi 赵玉明, you have successfully connected over SSH.
Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:
git clone ssh://zym@10.1.11.145:29418/REPOSITORY_NAME.git
Connection to 10.1.11.145 closed.
senrsl@senrsl-T540p:~/test/repo/kernel-android-common$ ssh -p 29418 -i ~/.ssh/id_rsa.pub 10.1.11.145 -l zym
**** 欢迎使用代码审核服务 ****
Hi 赵玉明, you have successfully connected over SSH.
Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:
git clone ssh://zym@10.1.11.145:29418/REPOSITORY_NAME.git
Connection to 10.1.11.145 closed.
5,揉和
1)存储部署
初期估计部署三套gerrit服务器,分别为
以第一套为例。
- 第一套:平时测试学习用;
- 第二套:公司内部正式项目用;
- 第三套:对外
结构设计如下:
目录名展示全部大写。
- [gerrit@Android git]$ tree -L 1
- .
- ├── All-Projects.git
- ├── All-Users.git
- ├── KERNEL -> /home/git-ro/repos/kernel
- ├── KVT49L -> /home/git-ro/repos/kvt49l
- ├── RELEASE -> /home/git-ro/repos/release
- └── test-gerrit.git
- 6 directories, 0 files
- [gerrit@Android git]$
实际结构如下:
无视上面的几个测试数据吧,那是之前的遗留。。。。
- [dc@Android repos]$ tree -L 2
- .
- ├── kernel
- │ ├── test
- │ └── test03.git
- ├── kvt49l
- │ └── test01.git
- ├── manifest.git
- │ ├── branches
- │ ├── config
- │ ├── description
- │ ├── HEAD
- │ ├── hooks
- │ ├── info
- │ ├── objects
- │ └── refs
- ├── master.zip
- ├── pro
- │ ├── pro1.git
- │ └── pro2.git
- ├── pro3.git
- │ ├── branches
- │ ├── config
- │ ├── description
- │ ├── HEAD
- │ ├── hooks
- │ ├── info
- │ ├── objects
- │ └── refs
- ├── release
- │ ├── deb4.4.2r2.git
- │ └── deb6.0.0r26.git
- ├── repo
- │ ├── color.py
- │ ├── command.py
- │ ├── COPYING
- │ ├── docs
- │ ├── editor.py
- │ ├── error.py
- │ ├── git_command.py
- │ ├── git_config.py
- │ ├── git_refs.py
- │ ├── git_ssh
- │ ├── hooks
- │ ├── main.py
- │ ├── manifest_loader.py
- │ ├── manifest.py
- │ ├── manifest_submodule.py
- │ ├── manifest_xml.py
- │ ├── pager.py
- │ ├── progress.py
- │ ├── project.py
- │ ├── repo
- │ ├── subcmds
- │ ├── SUBMITTING_PATCHES
- │ ├── tests
- │ └── trace.py
- └── repo.git
- 29 directories, 27 files
- [dc@Android repos]$
在网页上显示效果如下:
这个设计需要各种文件夹区分,就像是android source拉取的时候 repo init -u https://android.googlesource.com /platform/manifest库在platform文件夹下。。。。
在网页上直接创建这种结构pro/pro1直接报错。。。。
昨日百思不得其解
然后晚上拉屎的时候突然顿悟,直接在目录上mkdir然后建库不就行了吗。。。。
然后今天早上试,果然,在磁盘上改了以后重启下service gerrit stop,再start网页上就显示这种多层结构了。。。。
然后网页上虽然显示了,但点击这种多层的库,显示找不到或没权限,
然后又找了小半天,终于找到是apache默认不支持%2F这种方式,,,,在日志里看到路径都是这种。。。。
然后,百度谷歌都说直接在apache的配置文件里加AllowEncodedSlashes On就好了。。。。
但是我试半天不行。。。。
然后,偶然在ProxyPass加了个nocanon参数,突然就能访问了。。。。。
现在的这个配置文件变成了这样:
增加了上面那俩标黑的。。。。
- [root@Android conf.d]# cat gerrit.conf
- <Directory / >
- Options FollowSymLinks
- AllowOverride None
- </Directory>
- SetEnv GIT_PROJECT_ROOT /home/dc/repos/
- SetEnv GIT_HTTP_EXPORT_ALL
- ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
- ServerName localhost
- ProxyRequests Off
- ProxyVia Off
- ProxyPreserveHost On
- AllowEncodedSlashes On
- <Proxy *>
- Order deny,allow
- Allow from all
- </Proxy>
- <Location "/gerrit/login/">
- AuthType Basic
- AuthName "GCR"
- AuthBasicProvider file
- AuthUserFile /etc/gerrit.passwd
- Require valid-user
- </Location>
- ProxyPass /gerrit http://localhost:8081/gerrit nocanon
- [root@Android conf.d]# pwd
- /etc/httpd/conf.d
- [root@Android conf.d]#
回头一看,上面这一段牢骚得有多少然后啊。。。。。算了,还是不检查上面这段了。。。。
目前结构里的三个文件夹:
因为用的是git-ro的软链,所以应该是有读的权限没有写的权限,估计还得改权限,或者用之前的gitosis之类的配置权限。。。。
- KERNEL 下面放所有内核的库;
- KVT49L 这个是我用的Nexus7的源码版本号,里面放这套的android source,新的android source跟他平级,要是都建文件夹显得多空啊。。。。
- RELEASE 这里面放的是编译好生成了可以直接拿来用的东西,里面的俩deb*是之前编译的Nexus7的俩系统版本
所以需要先对测试库进行测试,再上传本地的代码库。。。。
2)测试测试库
拉取代码,修改,上传审核,同步
切换普通用户
拉取代码,修改,上传审核,同步
以release/deb4.4.2r2为例
①不能修改库的描述信息
找了一遭发现当前用户是gerrit,库的组是dc,组内权限770就能写了。。。。
②不能拉取
试了下,从其他地方git init --bare test01.git这种方式建的库链过去不能拉取。。。。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/RELEASE/deb4.4.2r2.git
- 正克隆到 'deb4.4.2r2'...
- 检查连接... 完成。
- warning: 远程 HEAD 指向一个不存在的引用,无法检出。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$
从gerrit网页建的库再挪到外面修改所有者再链回来就能拉取。。。。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/test_r/test-gerrit.git
- 正克隆到 'test-gerrit'...
- remote: Counting objects: 8, done
- remote: Finding sources: 100% (8/8)
- 展开对象中: 100% (8/8), 完成.
- remote: Total 8 (delta 0), reused 6 (delta 0)
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$
说明两者结构有不同的地方
也就是说,要把既有库迁移到gerrit上
可以先在gerrit上创建,然后把既有的push上。
或者
这个问题,一开始怀疑配置不同,找了一遭也不是配置不同;
又怀疑所有者或者权限问题,试了半天也不是;
然后把之前的pro3.git ln -s过去,发现pro3正常。。。。
难道不能clone空的版本库???
然后尝试
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone dc@10.1.11.145:/home/dc/repos/test/test02.git
- 正克隆到 'test02'...
- dc@10.1.11.145's password:
- Permission denied, please try again.
- dc@10.1.11.145's password:
- Permission denied, please try again.
- dc@10.1.11.145's password:
- 检查连接... 完成。
- warning: 远程 HEAD 指向一个不存在的引用,无法检出。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone git://10.1.11.145/repos/test/test02.git
- 正克隆到 'test02'...
- 检查连接... 完成。
- warning: 远程 HEAD 指向一个不存在的引用,无法检出。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$
这肯定是建的库有问题。。。。。。。
服务器上新建一个test_r/test03.git
- [dc@Android test]$ git init --bare test03.git
- 初始化空的 Git 仓库于 /home/dc/repos/test/test03.git/
- [dc@Android test]$
客户端
哎,果然不能是空的呢。。。。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone git://10.1.11.145/repos/test/test03.git
- 正克隆到 'test03'...
- warning: 您似乎克隆了一个空仓库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone dc@10.1.11.145:/home/dc/repos/test/test03.git
- 正克隆到 'test03'...
- dc@10.1.11.145's password:
- warning: 您似乎克隆了一个空仓库。
- 检查连接... 完成。
- #此时重启gerrit完成,gerrit已读到test_r/test03.git
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/test_r/test03.git
- 正克隆到 'test03'...
- 检查连接... 完成。
- warning: 远程 HEAD 指向一个不存在的引用,无法检出。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone git://10.1.11.145/repos/test/test03.git
- 正克隆到 'test03'...
- warning: 您似乎克隆了一个空仓库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone dc@10.1.11.145:/home/dc/repos/test/test03.git
- 正克隆到 'test03'...
- dc@10.1.11.145's password:
- warning: 您似乎克隆了一个空仓库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/test_r/test03.git
- 正克隆到 'test03'...
- 检查连接... 完成。
- warning: 远程 HEAD 指向一个不存在的引用,无法检出。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone dc@10.1.11.145:/home/dc/repos/test/test03.git
- 正克隆到 'test03'...
- dc@10.1.11.145's password:
- warning: 您似乎克隆了一个空仓库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ cd test03/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ ll
- 总用量 12
- drwxrwxr-x 3 senrsl senrsl 4096 12月 25 19:40 ./
- drwxrwxr-x 5 senrsl senrsl 4096 12月 25 19:40 ../
- drwxrwxr-x 7 senrsl senrsl 4096 12月 25 19:40 .git/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ touch README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ echo 'test03'>>README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ git commit -am 'test'
- 位于分支 master
- 初始提交
- 未跟踪的文件:
- README
- 提交为空,但是存在尚未跟踪的文件
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ git add .
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ git commit -m 'test'
- [master(根提交) 48b916e] test
- 1 file changed, 1 insertion(+)
- create mode 100644 README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ git push origin master
- dc@10.1.11.145's password:
- 对象计数中: 3, 完成.
- 写入对象中: 100% (3/3), 204 bytes | 0 bytes/s, 完成.
- Total 3 (delta 0), reused 0 (delta 0)
- To dc@10.1.11.145:/home/dc/repos/test/test03.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ git pull
- dc@10.1.11.145's password:
- Already up-to-date.
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ git clone http://10.1.11.145/gerrit/test_r/test03.git
- 正克隆到 'test03'...
- remote: Counting objects: 3, done
- remote: Finding sources: 100% (3/3)
- 展开对象中: 100% (3/3), 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4/test03$ cd ~/test/repo/repo_test4
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/test_r/test03.git
- 正克隆到 'test03'...
- remote: Counting objects: 3, done
- remote: Finding sources: 100% (3/3)
- 展开对象中: 100% (3/3), 完成.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$
然后测试其他的
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone dc@10.1.11.145:/home/dc/repos/release/deb4.4.2r2.git
- 正克隆到 'deb4.4.2r2'...
- dc@10.1.11.145's password:
- 检查连接... 完成。
- warning: 远程 HEAD 指向一个不存在的引用,无法检出。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone dc@10.1.11.145:/home/dc/repos/release/deb6.0.0r26.git
- 正克隆到 'deb6.0.0r26'...
- dc@10.1.11.145's password:
- Permission denied, please try again.
- dc@10.1.11.145's password:
- warning: 您似乎克隆了一个空仓库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$
然后把deb6.0.0r26的内容拷过来上传
原路提交回去,然后用gerrit拉取,然后修改,拉取都可以
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ cd deb6.0.0r26/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ ll
- 总用量 543016
- drwxrwxr-x 3 senrsl senrsl 4096 12月 25 19:51 ./
- drwxrwxr-x 7 senrsl senrsl 4096 12月 25 19:50 ../
- -rw-rw-r-- 1 senrsl senrsl 26 11月 21 16:33 android-info.txt
- -rw-r--r-- 1 senrsl senrsl 7645184 11月 21 17:28 boot.img
- -rw-r--r-- 1 senrsl senrsl 4776084 11月 21 17:23 cache.img
- -rw-rw-r-- 1 senrsl senrsl 72951 11月 21 17:37 clean_steps.mk
- drwxrwxr-x 7 senrsl senrsl 4096 12月 25 19:50 .git/
- -rw-rw-r-- 1 senrsl senrsl 76336 11月 21 17:58 installed-files.txt
- -rw-rw-r-- 1 senrsl senrsl 6720784 11月 21 16:56 kernel
- -rw-rw-r-- 1 senrsl senrsl 808 11月 21 17:37 previous_build_config.mk
- -rw-rw-r-- 1 senrsl senrsl 921319 11月 21 17:28 ramdisk.img
- -rw-rw-r-- 1 senrsl senrsl 1683595 11月 21 17:40 ramdisk-recovery.img
- -rw-rw-r-- 1 senrsl senrsl 67 11月 21 17:40 recovery.id
- -rw-r--r-- 1 senrsl senrsl 8409088 11月 21 17:40 recovery.img
- -rw-r--r-- 1 senrsl senrsl 385087792 11月 21 17:59 system.img
- -rw-r--r-- 1 senrsl senrsl 140606144 11月 21 17:46 userdata.img
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ touch README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ echo '6.0.0r26'>>README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git add .
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git commit -m 'init'
- [master(根提交) d053be4] init
- 14 files changed, 1571 insertions(+)
- create mode 100644 README
- create mode 100644 android-info.txt
- create mode 100644 boot.img
- create mode 100644 cache.img
- create mode 100644 clean_steps.mk
- create mode 100644 installed-files.txt
- create mode 100644 kernel
- create mode 100644 previous_build_config.mk
- create mode 100644 ramdisk-recovery.img
- create mode 100644 ramdisk.img
- create mode 100644 recovery.id
- create mode 100644 recovery.img
- create mode 100644 system.img
- create mode 100644 userdata.img
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git push origin master
- dc@10.1.11.145's password:
- 对象计数中: 16, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (14/14), 完成.
- 写入对象中: 100% (16/16), 210.63 MiB | 3.91 MiB/s, 完成.
- Total 16 (delta 5), reused 0 (delta 0)
- To dc@10.1.11.145:/home/dc/repos/release/deb6.0.0r26.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git pull
- dc@10.1.11.145's password:
- Already up-to-date.
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ cd
- senrsl@senrsl-T540p:~$ cd test/repo/repo_test4
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ ll
- 总用量 24
- drwxrwxr-x 6 senrsl senrsl 4096 12月 25 19:55 ./
- drwxrwxr-x 14 senrsl senrsl 4096 12月 25 16:58 ../
- drwxrwxr-x 3 senrsl senrsl 4096 12月 25 19:49 deb4.4.2r2/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 25 19:21 pro3/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 25 19:42 test03/
- drwxrwxr-x 3 senrsl senrsl 4096 12月 25 19:19 test-gerrit/
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git
- 正克隆到 'deb6.0.0r26'...
- remote: Counting objects: 16, done
- remote: Finding sources: 100% (16/16)
- remote: Total 16 (delta 0), reused 0 (delta 0)
- 展开对象中: 100% (16/16), 完成.
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ cd deb6.0.0r26/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ echo '上传'>>README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git add .
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ $ git commit -m '审核测'[master b3bf6ae] 审核测试
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (2/2), 完成.
- 写入对象中: 100% (3/3), 293 bytes | 0 bytes/s, 完成.
- Total 3 (delta 1), reused 0 (delta 0)
- remote: Resolving deltas: 100% (1/1)
- remote: Processing changes: refs: 1, done
- remote: ERROR: missing Change-Id in commit message footer
- remote:
- remote: Hint: To automatically insert Change-Id, install the hook:
- remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- remote: And then amend the commit:
- remote: git commit --amend
- remote:
- To http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git
- ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)
- error: 无法推送一些引用到 'http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git'
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- commit-msg 100% 4663 4.6KB/s 00:00
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (2/2), 完成.
- 写入对象中: 100% (3/3), 293 bytes | 0 bytes/s, 完成.
- Total 3 (delta 1), reused 0 (delta 0)
- remote: Resolving deltas: 100% (1/1)
- remote: Processing changes: refs: 1, done
- remote: ERROR: missing Change-Id in commit message footer
- remote:
- remote: Hint: To automatically insert Change-Id, install the hook:
- remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- remote: And then amend the commit:
- remote: git commit --amend
- remote:
- To http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git
- ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)
- error: 无法推送一些引用到 'http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git'
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git log
- commit b3bf6ae426bae8a39e64c9e72714e60c6d92295f
- Author: senRsl <senRsl@163.com>
- Date: Fri Dec 25 19:58:18 2015 +0800
- 审核测试
- commit d053be4d8f265d4a577395fb83e811fd30b7b2d5
- Author: senRsl <senRsl@163.com>
- Date: Fri Dec 25 19:52:46 2015 +0800
- init
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git commit --amend
- [master 25ae950] this is 审核测试
- Date: Fri Dec 25 19:58:18 2015 +0800
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (2/2), 完成.
- 写入对象中: 100% (3/3), 340 bytes | 0 bytes/s, 完成.
- Total 3 (delta 1), reused 0 (delta 0)
- remote: Resolving deltas: 100% (1/1)
- remote: Processing changes: new: 1, refs: 1, done
- remote:
- remote: New Changes:
- remote: http://10.1.11.145/gerrit/6 this is 审核测试
- remote:
- To http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git
- * [new branch] HEAD -> refs/for/master
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git pull
- 来自 http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26
- d053be4..25ae950 master -> origin/master
- Already up-to-date.
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$
然后在网页修改这个项目的描述,本地再拉取修改
基本可以说明只要项目不是空的再修改描述就没问题了。。。。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git
- 正克隆到 'deb6.0.0r26'...
- remote: Counting objects: 19, done
- remote: Finding sources: 100% (19/19)
- remote: Total 19 (delta 1), reused 4 (delta 1)
- 展开对象中: 100% (19/19), 完成.
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ cd deb6.0.0r26/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ ll
- 总用量 403412
- drwxrwxr-x 3 senrsl senrsl 4096 12月 25 20:06 ./
- drwxrwxr-x 7 senrsl senrsl 4096 12月 25 20:05 ../
- -rw-rw-r-- 1 senrsl senrsl 26 12月 25 20:06 android-info.txt
- -rw-rw-r-- 1 senrsl senrsl 7645184 12月 25 20:06 boot.img
- -rw-rw-r-- 1 senrsl senrsl 4776084 12月 25 20:06 cache.img
- -rw-rw-r-- 1 senrsl senrsl 72951 12月 25 20:06 clean_steps.mk
- drwxrwxr-x 8 senrsl senrsl 4096 12月 25 20:06 .git/
- -rw-rw-r-- 1 senrsl senrsl 76336 12月 25 20:06 installed-files.txt
- -rw-rw-r-- 1 senrsl senrsl 6720784 12月 25 20:06 kernel
- -rw-rw-r-- 1 senrsl senrsl 808 12月 25 20:06 previous_build_config.mk
- -rw-rw-r-- 1 senrsl senrsl 921319 12月 25 20:06 ramdisk.img
- -rw-rw-r-- 1 senrsl senrsl 1683595 12月 25 20:06 ramdisk-recovery.img
- -rw-rw-r-- 1 senrsl senrsl 16 12月 25 20:06 README
- -rw-rw-r-- 1 senrsl senrsl 67 12月 25 20:06 recovery.id
- -rw-rw-r-- 1 senrsl senrsl 8409088 12月 25 20:06 recovery.img
- -rw-rw-r-- 1 senrsl senrsl 385087792 12月 25 20:06 system.img
- -rw-rw-r-- 1 senrsl senrsl 140606144 12月 25 20:06 userdata.img
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ echo 'modify desc'>>README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git add .
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git commit -m 'modify'
- [master e280a5e] modify
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (2/2), 完成.
- 写入对象中: 100% (3/3), 289 bytes | 0 bytes/s, 完成.
- Total 3 (delta 1), reused 0 (delta 0)
- remote: Resolving deltas: 100% (1/1)
- remote: Processing changes: refs: 1, done
- remote: ERROR: missing Change-Id in commit message footer
- remote:
- remote: Hint: To automatically insert Change-Id, install the hook:
- remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- remote: And then amend the commit:
- remote: git commit --amend
- remote:
- To http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git
- ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)
- error: 无法推送一些引用到 'http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git'
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- commit-msg 100% 4663 4.6KB/s 00:00
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git commit --amend
- [master 4f25984] this is is modify
- Date: Fri Dec 25 20:07:07 2015 +0800
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (2/2), 完成.
- 写入对象中: 100% (3/3), 335 bytes | 0 bytes/s, 完成.
- Total 3 (delta 1), reused 0 (delta 0)
- remote: Resolving deltas: 100% (1/1)
- remote: Processing changes: new: 1, refs: 1, done
- remote:
- remote: New Changes:
- remote: http://10.1.11.145/gerrit/7 this is is modify
- remote:
- To http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26.git
- * [new branch] HEAD -> refs/for/master
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$ git pull
- 来自 http://10.1.11.145/gerrit/RELEASE/deb6.0.0r26
- 25ae950..4f25984 master -> origin/master
- Already up-to-date.
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb6.0.0r26$
果然上过第一次之后再随便折腾都很容易上了吗。。。。
看一下体积
客户端上的:
服务器上的:
- senrsl@senrsl-T540p:~$ cd android/source/out/
- senrsl@senrsl-T540p:~/android/source/out$ du -h --max-depth=1 deb6.0.0r26
- 531M deb6.0.0r26
- senrsl@senrsl-T540p:~/android/source/out$ cd ~/test/repo/repo_test4/
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ du -h --max-depth=1 deb6.0.0r26
- 236M deb6.0.0r26/.git
- 629M deb6.0.0r26
- senrsl@senrsl-T540p:~/test/repo/repo_test4$
哎,新申请的1T服务器又可以使劲作了~~~
- [dc@Android repos]$ du -h --max-depth=1 release/deb6.0.0r26.git
- 16K release/deb6.0.0r26.git/logs
- 52K release/deb6.0.0r26.git/refs
- 4.0K release/deb6.0.0r26.git/branches
- 44K release/deb6.0.0r26.git/hooks
- 8.0K release/deb6.0.0r26.git/info
- 235M release/deb6.0.0r26.git/objects
- 236M release/deb6.0.0r26.git
- [dc@Android repos]$ du -h --max-depth=1 release
- 128K release/deb4.4.2r2.git
- 236M release/deb6.0.0r26.git
- 236M release
- [dc@Android repos]$
3)本地代码上传
①方式:继承于上
上传另一个release,deb442版本
这么搞太麻烦了,那么一堆库。。。。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone dc@10.1.11.145:/home/dc/repos/release/deb4.4.2r2.git
- 正克隆到 'deb4.4.2r2'...
- dc@10.1.11.145's password:
- warning: 您似乎克隆了一个空仓库。
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ cd deb4.4.2r2/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ touch README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ echo 'deb442r2'>>README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git add .
- gisenrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git commit -m 'init'
- [master(根提交) beaa4b5] init
- 13 files changed, 1344 insertions(+)
- create mode 100644 README
- create mode 100644 android-info.txt
- create mode 100644 boot.img
- create mode 100644 cache.img
- create mode 100644 clean_steps.mk
- create mode 100644 installed-files.txt
- create mode 100644 kernel
- create mode 100644 previous_build_config.mk
- create mode 100644 ramdisk-recovery.img
- create mode 100644 ramdisk.img
- create mode 100644 recovery.img
- create mode 100644 system.img
- create mode 100644 userdata.img
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git push origin master
- dc@10.1.11.145's password:
- 对象计数中: 15, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (13/13), 完成.
- 写入对象中: 100% (15/15), 172.39 MiB | 11.22 MiB/s, 完成.
- Total 15 (delta 5), reused 0 (delta 0)
- To dc@10.1.11.145:/home/dc/repos/release/deb4.4.2r2.git
- * [new branch] master -> master
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ cd ..
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ rm -rf deb4.4.2r2
- #此时,服务器上gerrit可以修改deb442的desc
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/RELEASE/deb4.4.2r2.git
- 正克隆到 'deb4.4.2r2'...
- remote: Counting objects: 15, done
- remote: Finding sources: 100% (15/15)
- remote: Total 15 (delta 0), reused 0 (delta 0)
- 展开对象中: 100% (15/15), 完成.
- 检查连接... 完成。
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ cd deb4.4.2r2/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ echo 'hook'>>README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git add .
- gsenrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git commit -m 'hook'
- [master e865758] hook
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- commit-msg 100% 4663 4.6KB/s 00:00
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git commit --amend
- [master 07ed2a1] is hook
- Date: Fri Dec 25 20:38:32 2015 +0800
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (2/2), 完成.
- 写入对象中: 100% (3/3), 313 bytes | 0 bytes/s, 完成.
- Total 3 (delta 1), reused 0 (delta 0)
- remote: Resolving deltas: 100% (1/1)
- remote: Processing changes: new: 1, refs: 1, done
- remote:
- remote: New Changes:
- remote: http://10.1.11.145/gerrit/8 is hook
- remote:
- To http://10.1.11.145/gerrit/RELEASE/deb4.4.2r2.git
- * [new branch] HEAD -> refs/for/master
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$ git pull
- 来自 http://10.1.11.145/gerrit/RELEASE/deb4.4.2r2
- beaa4b5..07ed2a1 master -> origin/master
- Already up-to-date.
- senrsl@senrsl-T540p:~/test/repo/repo_test4/deb4.4.2r2$
应该尝试服务器初始化,本地直接上传过去,然后gerrit拉取验证。。。。也很麻烦。。。。
应该写个脚本自己搞。。。。
这个也很麻烦。。。。
②方式:本地已存库
对于单纯的git仓库,这种方式好
分支都克隆下来了。。。。
- senrsl@senrsl-T540p:~/android/source/kernel/goldfish$ git branch
- android-3.10
- android-3.4
- android-goldfish-2.6.29
- * android-goldfish-3.4
- master
- senrsl@senrsl-T540p:~/android/source/kernel/goldfish$ cd ..
- senrsl@senrsl-T540p:~/android/source/kernel$ git clone --bare goldfish goldfish.git
- 克隆到纯仓库 'goldfish.git'...
- 完成。
- senrsl@senrsl-T540p:~/android/source/kernel$ cd goldfish.git/
- senrsl@senrsl-T540p:~/android/source/kernel/goldfish.git$ git branch
- android-3.10
- android-3.4
- android-goldfish-2.6.29
- * android-goldfish-3.4
- master
- senrsl@senrsl-T540p:~/android/source/kernel/goldfish.git$ cd ..
- senrsl@senrsl-T540p:~/android/source/kernel$
然后把他移动到服务器上去
用scp
centos上默认没装,安装
然后本地复制过去
- [root@Android kernel]# yum install scp
- 已加载插件:fastestmirror
- 设置安装进程
- Determining fastest mirrors
- * base: mirrors.aliyun.com
- * extras: mirrors.yun-idc.com
- * updates: mirrors.yun-idc.com
- base | 3.7 kB 00:00
- extras | 2.9 kB 00:00
- updates | 3.4 kB 00:00
- No package scp available.
- 错误:无须任何处理
- [root@Android kernel]# yum install openssh-clients
- 已加载插件:fastestmirror
- 设置安装进程
- Loading mirror speeds from cached hostfile
- * base: mirrors.aliyun.com
- * extras: mirrors.yun-idc.com
- * updates: mirrors.yun-idc.com
- 解决依赖关系
- --> 执行事务检查
- ---> Package openssh-clients.x86_64 0:5.3p1-112.el6_7 will be 安装
- --> 处理依赖关系 libedit.so.0()(64bit),它被软件包 openssh-clients-5.3p1-112.el6_7.x86_64 需要
- --> 执行事务检查
- ---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be 安装
- --> 完成依赖关系计算
- 依赖关系解决
- ============================================================================
- 软件包 架构 版本 仓库 大小
- ============================================================================
- 正在安装:
- openssh-clients x86_64 5.3p1-112.el6_7 updates 438 k
- 为依赖而安装:
- libedit x86_64 2.11-4.20080712cvs.1.el6 base 74 k
- 事务概要
- ============================================================================
- Install 2 Package(s)
- 总下载量:513 k
- Installed size: 1.4 M
- 确定吗?[y/N]:y
- 下载软件包:
- (1/2): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm | 74 kB 00:00
- (2/2): openssh-clients-5.3p1-112.el6_7.x86_64.rpm | 438 kB 00:00
- ----------------------------------------------------------------------------
- 总计 2.3 MB/s | 513 kB 00:00
- 运行 rpm_check_debug
- 执行事务测试
- 事务测试成功
- 执行事务
- 正在安装 : libedit-2.11-4.20080712cvs.1.el6.x86_64 1/2
- 正在安装 : openssh-clients-5.3p1-112.el6_7.x86_64 2/2
- Verifying : openssh-clients-5.3p1-112.el6_7.x86_64 1/2
- Verifying : libedit-2.11-4.20080712cvs.1.el6.x86_64 2/2
- 已安装:
- openssh-clients.x86_64 0:5.3p1-112.el6_7
- 作为依赖被安装:
- libedit.x86_64 0:2.11-4.20080712cvs.1.el6
- 完毕!
- [root@Android kernel]# scp
- usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
- [-l limit] [-o ssh_option] [-P port] [-S program]
- [[user@]host1:]file1 ... [[user@]host2:]file2
- [root@Android kernel]#
然后在网页上加上desc,然后测试拉取代码
- senrsl@senrsl-T540p:~/android/source/kernel$ scp
- usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
- [-l limit] [-o ssh_option] [-P port] [-S program]
- [[user@]host1:]file1 ... [[user@]host2:]file2
- senrsl@senrsl-T540p:~/android/source/kernel$ scp -r goldfish.git dc@10.1.11.145:/home/dc/repos/kernel/
- dc@10.1.11.145's password:
- bash: scp: command not found
- lost connection
- senrsl@senrsl-T540p:~/android/source/kernel$ scp -r goldfish.git dc@10.1.11.145:/home/dc/repos/kernel/
- dc@10.1.11.145's password:
- exclude 100% 240 0.2KB/s 00:00
- HEAD 100% 37 0.0KB/s 00:00
- packed-refs 100% 376 0.4KB/s 00:00
- config 100% 135 0.1KB/s 00:00
- pre-push.sample 100% 1348 1.3KB/s 00:00
- pre-commit.sample 100% 1642 1.6KB/s 00:00
- post-update.sample 100% 189 0.2KB/s 00:00
- applypatch-msg.sample 100% 478 0.5KB/s 00:00
- pre-rebase.sample 100% 4951 4.8KB/s 00:00
- update.sample 100% 3611 3.5KB/s 00:00
- pre-applypatch.sample 100% 424 0.4KB/s 00:00
- prepare-commit-msg.sample 100% 1239 1.2KB/s 00:00
- commit-msg.sample 100% 896 0.9KB/s 00:00
- pack-31c915b9a9f50a1073ea797a7912d63d8c3d8937 100% 622MB 11.1MB/s 00:56
- pack-31c915b9a9f50a1073ea797a7912d63d8c3d8937 100% 83MB 11.8MB/s 00:07
- description 100% 73 0.1KB/s 00:00
- senrsl@senrsl-T540p:~/android/source/kernel$
然后测试修改代码
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ git clone http://10.1.11.145/gerrit/KERNEL/goldfish.git
- 正克隆到 'goldfish'...
- remote: Counting objects: 3089386, done
- remote: Finding sources: 100% (3089386/3089386)
- remote: Total 3089386 (delta 2595426), reused 3089367 (delta 2595426)
- 接收对象中: 100% (3089386/3089386), 619.49 MiB | 11.22 MiB/s, 完成.
- 处理 delta 中: 100% (2595426/2595426), 完成.
- 检查连接... 完成。
- 正在检出文件: 100% (38890/38890), 完成.
- senrsl@senrsl-T540p:~/test/repo/repo_test4$ cd goldfish/
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git branch
- * android-goldfish-3.4
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git branchs
- git:'branchs' 不是一个 git 命令。参见 'git --help'。
- 您指的是这个么?
- branch
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git branch -r
- origin/HEAD -> origin/android-goldfish-3.4
- origin/android-3.10
- origin/android-3.4
- origin/android-goldfish-2.6.29
- origin/android-goldfish-3.4
- origin/master
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$
跑网页gitweb里看上传结果。
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ vi README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git add .
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git commit -m 'edit README'
- [android-goldfish-3.4 56b6a6b] edit README
- 1 file changed, 7 insertions(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git push origin master
- error: src refspec master does not match any.
- error: 无法推送一些引用到 'http://10.1.11.145/gerrit/KERNEL/goldfish.git'
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git branch
- * android-goldfish-3.4
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git push origin android-goldfish-3.4
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (3/3), 完成.
- 写入对象中: 100% (3/3), 325 bytes | 0 bytes/s, 完成.
- Total 3 (delta 2), reused 0 (delta 0)
- remote: Resolving deltas: 100% (2/2)
- remote: Processing changes: refs: 1, done
- To http://10.1.11.145/gerrit/KERNEL/goldfish.git
- ea97df6..56b6a6b android-goldfish-3.4 -> android-goldfish-3.4
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$
然后测试审核推送
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ vi README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git add .
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git commit -m 'gcr test'
- [android-goldfish-3.4 ad59a73] gcr test
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git push origin HEAD:refs/for/master
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (3/3), 完成.
- 写入对象中: 100% (3/3), 318 bytes | 0 bytes/s, 完成.
- Total 3 (delta 2), reused 0 (delta 0)
- remote: Resolving deltas: 100% (2/2)
- remote: Processing changes: refs: 1, done
- To http://10.1.11.145/gerrit/KERNEL/goldfish.git
- ! [remote rejected] HEAD -> refs/for/master (no common ancestry)
- error: 无法推送一些引用到 'http://10.1.11.145/gerrit/KERNEL/goldfish.git'
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- commit-msg 100% 4663 4.6KB/s 00:00
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git push origin HEAD:refs/for/android-goldfish-3.4
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (3/3), 完成.
- 写入对象中: 100% (3/3), 318 bytes | 0 bytes/s, 完成.
- Total 3 (delta 2), reused 0 (delta 0)
- remote: Resolving deltas: 100% (2/2)
- remote: Processing changes: refs: 1, done
- remote: ERROR: missing Change-Id in commit message footer
- remote:
- remote: Hint: To automatically insert Change-Id, install the hook:
- remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 zym@10.1.11.145:hooks/commit-msg ${gitdir}/hooks/
- remote: And then amend the commit:
- remote: git commit --amend
- remote:
- To http://10.1.11.145/gerrit/KERNEL/goldfish.git
- ! [remote rejected] HEAD -> refs/for/android-goldfish-3.4 (missing Change-Id in commit message footer)
- error: 无法推送一些引用到 'http://10.1.11.145/gerrit/KERNEL/goldfish.git'
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ ^C
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git commit --amend
- [android-goldfish-3.4 5ffe58e] this is is is is amend
- Date: Mon Dec 28 14:45:56 2015 +0800
- 1 file changed, 1 insertion(+)
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git push origin HEAD:refs/for/android-goldfish-3.4
- 对象计数中: 3, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (3/3), 完成.
- 写入对象中: 100% (3/3), 373 bytes | 0 bytes/s, 完成.
- Total 3 (delta 2), reused 0 (delta 0)
- remote: Resolving deltas: 100% (2/2)
- remote: Processing changes: new: 1, refs: 1, done
- remote:
- remote: New Changes:
- remote: http://10.1.11.145/gerrit/9 this is is is is amend
- remote:
- To http://10.1.11.145/gerrit/KERNEL/goldfish.git
- * [new branch] HEAD -> refs/for/android-goldfish-3.4
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git log -2
- commit 5ffe58e2d45a57476c90d121e2e88297d7413f20
- Author: senRsl <senRsl@163.com>
- Date: Mon Dec 28 14:45:56 2015 +0800
- this is is is is amend
- gcr test
- Change-Id: I793a64bab5019180658c7a028f91030d0a764e5a
- commit 56b6a6b23ef242d57f4fdb12e258b5814c7ea47e
- Author: senRsl <senRsl@163.com>
- Date: Mon Dec 28 14:43:11 2015 +0800
- edit README
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$
网页审核,审核提交后本地再拉取代码
这种方式可行!!!
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$ git pull
- 来自 http://10.1.11.145/gerrit/KERNEL/goldfish
- 56b6a6b..5ffe58e android-goldfish-3.4 -> origin/android-goldfish-3.4
- Already up-to-date.
- senrsl@senrsl-T540p:~/test/repo/repo_test4/goldfish$
③方式:本地文件夹建库
服务器创建空白库
客户端初始化,然后指向上传
- [dc@Android abi]$ git init --bare cpp.git
- 初始化空的 Git 仓库于 /home/dc/repos/mx6/source/abi/cpp.git/
- senrsl@senrsl-T540p:~/android/source/MX6$ cd android_kk4.4.2_1.0.0/abi/cpp/
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/abi/cpp$ git init
- 初始化空的 Git 仓库于 /home/senrsl/android/source/MX6/android_kk4.4.2_1.0.0/abi/cpp/.git/
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/abi/cpp$ git remote add origin dc@10.1.11.145:/home/dc/repos/mx6/source/abi/cpp.git
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/abi/cpp$ git add .
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/abi/cpp$ git commit -m 'init'
- [master(根提交) 0ec1f81] init
- 19 files changed, 1259 insertions(+)
- create mode 100644 Android.mk
- create mode 100644 include/cxxabi.h
- create mode 100644 include/new
- create mode 100644 include/typeinfo
- create mode 100644 src/array_type_info.cc
- create mode 100644 src/class_type_info.cc
- create mode 100644 src/delete.cc
- create mode 100644 src/dynamic_cast.cc
- create mode 100644 src/enum_type_info.cc
- create mode 100644 src/function_type_info.cc
- create mode 100644 src/fundamental_type_info.cc
- create mode 100644 src/new.cc
- create mode 100644 src/pbase_type_info.cc
- create mode 100644 src/pointer_to_member_type_info.cc
- create mode 100644 src/pointer_type_info.cc
- create mode 100644 src/si_class_type_info.cc
- create mode 100644 src/type_info.cc
- create mode 100644 src/vmi_class_type_info.cc
- create mode 100644 use_rtti.mk
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/abi/cpp$ git push -u origin master
- dc@10.1.11.145's password:
- 对象计数中: 23, 完成.
- Delta compression using up to 8 threads.
- 压缩对象中: 100% (23/23), 完成.
- 写入对象中: 100% (23/23), 9.45 KiB | 0 bytes/s, 完成.
- Total 23 (delta 14), reused 0 (delta 0)
- To dc@10.1.11.145:/home/dc/repos/mx6/source/abi/cpp.git
- * [new branch] master -> master
- 分支 master 设置为跟踪来自 origin 的远程分支 master。
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/abi/cpp$
这种方式也可以
④方式:三的升级
写个脚本好了
服务器上也写个脚本好了
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/bionic$ cat push.sh
- #!/bin/bash
- git init
- #每次拷过去先改这个的路径
- git remote add origin dc@10.1.11.145:/home/dc/repos/mx6/source/bionic.git
- git add .
- git commit -m 'init'
- git push -u origin master
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0/bionic$
然后扔服务器上去,自动初始化这一堆库
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0$ cat bare.sh
- #!/bin/bash
- git init --bare bootable.git
- git init --bare build.git
- git init --bare cts.git
- git init --bare dalvik.git
- git init --bare developers.git
- git init --bare development.git
- git init --bare device.git
- git init --bare docs.git
- git init --bare external.git
- git init --bare frameworks.git
- git init --bare hardware.git
- git init --bare kernel_imx.git
- git init --bare libcore.git
- git init --bare libnativehelper.git
- git init --bare ndk.git
- git init --bare packages.git
- git init --bare pdk.git
- git init --bare prebuilts.git
- git init --bare sdk.git
- git init --bare system.git
- git init --bare tools.git
- senrsl@senrsl-T540p:~/android/source/MX6/android_kk4.4.2_1.0.0$
本地上边拷push.sh边改。
哎,要是能写个自动轮询目录然后自动获取文件夹名就好了,那样直接一执行就OK了。。。。
4)加入repo脚本
之前上传了厂商给的源码。。。。。
然后组织成repo来下来提交。。。。
库结构
建manifest库,写xml....
- [dc@Android source]$ tree -L 1
- .
- ├── abi
- │ └── cpp.git
- ├── art.git
- ├── bare.sh
- ├── bionic.git
- ├── bootable.git
- ├── build.git
- ├── cts.git
- ├── dalvik.git
- ├── developers.git
- ├── development.git
- ├── device.git
- ├── docs.git
- ├── external.git
- ├── frameworks.git
- ├── hardware.git
- ├── kernel_imx.git
- ├── libcore.git
- ├── libnativehelper.git
- ├── ndk.git
- ├── packages.git
- ├── pdk.git
- ├── prebuilts.git
- ├── sdk.git
- ├── system.git
- └── tools.git
- 24 directories, 1 file
- [dc@Android source]$
6,android源码服务器
之前下载到本地的那200G看来是下错了,貌似是需要加一个镜像的参数才行。。。。
服务器1:定时从官方同步代码;
服务器2:部署同步下来的代码,对公司内部使用;
1)从官方拉取镜像
本想找运维再开个虚拟机,一说要300G立马就不好了。。。。
好吧,那就从本机建个虚拟机搞吧。。。。
哎,没那么大空间。。。。算了,还是从本机开搞吧。。。。
原来官网上就有教程。。。。
- senrsl@senrsl-T540p:~/android/source$ mkdir MIRROR
- senrsl@senrsl-T540p:~/android/source$ cd MIRROR/
- senrsl@senrsl-T540p:~/android/source/MIRROR$ repo init -u https://android.googlesource.com/platform/manifest.git --mirror
- 。。。。
- repo mirror has been initialized in /home/senrsl/android/source/MIRROR
- senrsl@senrsl-T540p:~/android/source/MIRROR$ repo sync -j16
好吧,那就按官网上的地址来。。。。
把地址改成mirror。。。。
那么快就好了,而且90%的下载都没挂vpn....
- senrsl@senrsl-T540p:~/android/source/MIRROR$ repo init -u https://android.googlesource.com/mirror/manifest --mirror
- senrsl@senrsl-T540p:~/android/source/MIRROR$ ./sync_16.sh
- 。。。。
- Fetching projects: 100% (955/955), done.
- senrsl@senrsl-T540p:~/android/source/MIRROR$
库的体积果然要小很多呢。。。。
- senrsl@senrsl-T540p:~/android/source/MIRROR$ du -h --max-depth=1
- 536K ./mirror
- 5.7M ./.repo
- 41G ./platform
- 27G ./device
- 524K ./brillo
- 9.3G ./kernel
- 436K ./product
- 1.2G ./toolchain
- 69M ./trusty
- 132K ./accessories
- 3.9M ./git-repo.git
- 3.8M ./tools
- 78G .
- senrsl@senrsl-T540p:~/android/source/MIRROR$
然后拷到服务器上
传完以后拉取提交测试。。。。
- senrsl@senrsl-T540p:~/android/source$ scp -r MIRROR/* dc@10.1.11.145:/home/dc/repos/asop/
这个应该先在本地测试再上传,不过昨个赶着下班还是先上传吧。。。。
一开始扔服务器上,然后init -b的方式下载失败。。。。
还是得本地测试。。。。
这样成功检出master跟4.4.2r2分支
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo-internal init -u /home/senrsl/android/source/MIRROR/platform/manifest.git
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo sync -j16
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ cd .repo/manifests
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY/.repo/manifests$ git branch -a | cut -d / -f 3
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ cd ..
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo init -b android-4.4.2_r2
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo sync -j16
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ cd .repo/manifests
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY/.repo/manifests$ git branch -a | cut -d / -f 3
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo-internal init -u /home/senrsl/android/source/MIRROR/platform/manifest.git -b android-4.4.2_r2
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo sync -j16
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ cd .repo/manifests
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY/.repo/manifests$ git branch -a | cut -d / -f 3
为什么扔到服务器上就不行了。。。。
本地版测试一切正常,扔到内网服务器一堆404.。。。
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo-local init -u /home/senrsl/android/source/MIRROR/platform/manifest
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo-internal init -u http://10.1.11.145/gerrit/AOSP/platform/manifest
搜了一下说是下载源码的时候出现这个问题要去谷歌官方做认证。。。。
- Get http://10.1.11.145/gerrit/AOSP/platform/manifest
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
- curl: (22) The requested URL returned error: 404 Not Found
- Server does not provide clone.bundle; ignoring.
我这内网的服务器去哪认证。。。。
然后继续搜,突然发现清华有专门的教程!!!
还有专门一个地址教怎么建。。。mirrors.tuna.tsinghua.edu.cn/help/#AOSP
靠,怎么没早看见。。。。
他上面说 无视即可。。。。
可是无视一直同步失败啊。。。。
然后顺着找到了lug.ustc.edu.cn/wiki/mirrors/help/aosp这个大学的。。。。
哎,好想静静。。。。
可以考虑使用https....毕竟官方用的就是
我屮,这不科学啊。。。。
竟然同步成功了。。。。是因为没有加-j16吗。。。。
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo-internal init -u http://10.1.11.145/gerrit/AOSP/platform/manifest
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo sync
- 。。。。
- 正在检出文件: 100% (1186/1186), 完成.
- 正在检出文件: 100% (4269/4269), 完成.在检出文件: 19% (837/4269)
- 正在检出文件: 100% (19/19), 完成. 正在检出文件: 26% (5/19)
- Syncing work tree: 100% (503/503), done.
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
还是说因为刚才重启了一下服务器。。。。
好吧,能用了。。。。
2015年12月31日17:34:48
--
senRsl
2014年11月17日16:25:44
2014年11月17日16:25:44
没有评论 :
发表评论