当前位置:网站首页>Migrate repo managed code to Gerrit
Migrate repo managed code to Gerrit
2022-07-22 00:04:00 【Skinny shrimp playing basketball_】
transfer Repo Managed code to Gerrit
zhuhongxi 2022-7-5
Situation 1 :
If we get repo The source code is copied from other places , For example, the original factory packs and compresses the whole code to us , Note that the source code here refers to .git
Form of warehouse source code , Instead of the source code we really use to compile . This situation is similar to 8386 Code for , It is in the form of a compressed package release Give us the , After decompression, the source code warehouse , as follows :
[email protected]:/home/git/code/platform/MST8386$ ls
costar device git-repo.git hqtvrd kernel manifest.git mstar platform
In this case , We directly copy these warehouse directories to gerrit Of git The corresponding project directory under the directory , Then refresh gerrit Database index , Finally, reboot. gerrit You can complete the import of the warehouse , Keep all submission information , Including branches 、commit-id、tag Etc . If the copy mode is the same machine, you can directly cp, Different machines can be used scp The command is pushed to gerrit Of git Under the table of contents , Here we use N1_8386 Demonstrate for example :
su gerrit
cd ~
./gerrit_site/bin/gerrit.sh stop
cd gerrit_site/git/N1
cp -r /home/git/code/platform/MST8386/* .
cd ~
java -jar gerrit-3.1.3.war reindex -d gerrit_site
./gerrit_site/bin/gerrit.sh start
- Switch to gerrit user
- Shut down before copying gerrit service
- stay gerrit Of git Create the corresponding project directory under the directory and enter
- Copy the source code warehouse directory to the corresponding project directory ( Directly on the same machine cp)
- Refresh after copying gerrit Database index
- restart gerrit service
After uploading, let's observe gerrit The corresponding project directory on the server , You can see that it is exactly the same as the original directory .
[email protected]:~/gerrit_site/git/N1$ ls
costar device git-repo.git hqtvrd kernel manifest.git mstar platform
Then we test the pull code :
mkdir N1 && cd N1
mkdir -p images/oreo/Leo
mkdir sourcecode && cd sourcecode
hirepo init -u ssh://[email protected]:29418/N1/manifest -b cherry
hirepo sync
hirepo start cherry --all
hirepo forall -c 'git clean -df ./; git checkout ./; git pull aosp cherry'
source build/envsetup.sh
lunch Leo-userdebug
make_costar
We can execute under any warehouse in the pulled code :
git remote -vv
aosp ssh://[email protected]:29418/N1/platform/frameworks/base (fetch)
aosp ssh://[email protected]:29418/N1/platform/frameworks/base (push)
Only the direction of the far warehouse becomes ours gerrit Project path , Nothing else has changed .
Case 2 :
If we get the source code by pulling the original factory repo, Or from customers repo Take it from the warehouse , Or we and the original factory / Customer joint development , The code is on someone else's side , Usually we are repo sync Other people's code , In this case, we want to create our own gerrit The warehouse needs to pull the image warehouse of the remote source code first , Then deploy in case one . Here with bluebirds Q1 For example :
stay 252 The server first pulls the source image warehouse :
mkdir sourcecode && cd sourcecode
repo init -u ssh://[email protected]:29418/manifest -b seraphic_mlr53_projector_foxstar_001 --no-repo-verify --mirror
repo sync -j8
After pulling the image, we can see the composition of the image warehouse , You can see both of them .git
[email protected]:~/9266_v31_gerrit/sourcecode$ ls
git-repo.git projector_cusapp_foxstar.git projector_obj_foxstar.git projector_systembuild_foxstar.git
manifest.git projector_cusdata_foxstar.git projector_protect_foxstar.git projector_webui_foxstar.git
projector_common.git projector_library_foxstar.git projector_source_foxstar.git
Use scp Command push code to gerrit The server :
First, in the gerrit Make preparations on the server :
su gerrit
cd ~
./gerrit_site/bin/gerrit.sh stop
And then to 252 Server upload code :
cd -
scp -r sourcecode/* [email protected]:/home/gerrit/gerrit_site/git/Q1_9266
Because it's not on a machine , So we use scp Command to send the image warehouse directory to gerrit Of git Under the corresponding item in the directory :
Note that the goal of our code warehouse is 251 Server's gerrit User's home directory , therefore scp The goal is gerrit user , The corresponding project directory needs to be created by yourself .
After uploading the code , Refresh gerrit Database index , restart gerrit service (gerrit Operation on the server , Remember to use gerrit user )
cd ~
java -jar gerrit-3.1.3.war reindex -d gerrit_site
./gerrit_site/bin/gerrit.sh start
Pull and compile after uploading :
mkdir download && cd download
repo init -u ssh://[email protected]:29418/Q1_9266/manifest -b seraphic_mlr53_projector_foxstar_001 --no-repo-verify
repo sync
repo forall -c "git checkout Tag_seraphic_mlr53_projector_20220630_release_v31"
cd apollo/sys_build/sraf_linux/mt5867_ww_1g_foxstar_projector
make DAILY_BUILD=true ROOTFS_RW_SUPPORT=true 2>&1 | tee make.log
边栏推荐
- JMeter's BeanShell generates random Chinese characters
- Common functions of Charles
- Scene method practice
- MySQL之多表关联删除/更新
- Data driven testing of hand-in-hand teaching UI automation
- Navicat 16.1 provides a new choice of management development tools for oceanbase Community Edition
- Assembly realizes circular judgment on whether it is a square number by means of conditional transfer
- Learn IO from simple to deep
- Markdown and idea shortcut keys
- JProfiler installation and use tutorial
猜你喜欢
SQL | null value and SQL count() function
NFS FTP PXE
Programming technology of Servlet
Datagrip 2021 uses settings that make it smoother to use
What to do if the research and development quality is poor
How to choose the model for remote real machine test?
Use of source lnsight (read uboot under Samba share)
Using disassembly debugging and complement to explain 0x80000000 / -1 shaping output exception inconsistency
JMeter之JDBC连接/操作数据库
Quickly solve the problem that the computer wireless network cannot be connected
随机推荐
NFS FTP PXE
JMeter之聚合报告
LVM磁盘多分区扩容(fdisk,vgdata,lvdata,df,resize2fs,lvextend,partprobe)
Take you to easily decrypt the white box test and (Demo detailed explanation)
Peoplecode expression - basic expression
JMeter之以页面形式保存测试过程数据
软件测试常问面试题【三】
The danger of testing SQL | don't take it lightly
Assembly language homework
Architecture lamp - routeur MySQL (séparateur lecture - écriture)
Test case management tool recommendation
软件测试常问面试题【二】
Scene method practice
JProfiler installation and use tutorial
postman newman jenkins
Common functions of Charles
Peoplecode assigns values based on context references
Build server intranet Yum warehouse
LR load balancer management, distributed load generator
Install cross compiler: eabi-4.3.3_ EmbedSky_ 20100610.tar. bz2