CodePackager - Pack and Unpack repositories to mobile storage
-
Upload
cheyin-l -
Category
Technology
-
view
279 -
download
0
Transcript of CodePackager - Pack and Unpack repositories to mobile storage
![Page 1: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/1.jpg)
1
CodePackager
Pack and Unpack repositories to mobile storage
Speaker: Vincent CY LiaoDate: 2013-06-27
![Page 2: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/2.jpg)
2
Outline
■ Problem
■ CodePackager
● Configuration
● Command
![Page 3: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/3.jpg)
3
Problem
■ Problem
■ Old Solution
![Page 4: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/4.jpg)
4
Production NetworkDevelopment Network
source source
Problem
■ Separated network
■ Need move code between network
● Merge bug-fixes from production network
● Backup
![Page 5: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/5.jpg)
5
We used to...
■ Create a tar ball of updated code
■ Copy tar ball to mobile storage
■ Attach mobile storage on the other machine
■ Un-tar and merge modifications
![Page 6: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/6.jpg)
6
Boring
![Page 7: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/7.jpg)
7
Boring
![Page 8: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/8.jpg)
8
Very Boring
![Page 9: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/9.jpg)
9
… and human errors sometime
Such as over-written new files with old files
![Page 10: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/10.jpg)
10
CodePackager
■ Introduction
■ Configuration
■ Command
![Page 11: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/11.jpg)
11
Introduction
■ Pack tar-copy ~ copy-untar-pull/fetch into two commands
● prep_codepkg.py■ tar-copy
● recv_codepkg.py■ copy-untar-pull/fetch
■ Written in Python !
![Page 12: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/12.jpg)
12
Configuration
■ ~/.codepackager.yaml
● Local settings
● Path of mobile storage■ Assume use same mobile storage across projects
● Path of VCS executables
■ %REPO%/.codepackager.yaml
● Project name■ File name of tar-ball
● VCS type■ Mercurial■ Git
![Page 13: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/13.jpg)
13
Configuration (cont.)#package-name: codepackagerdevice-folder: /media/MY_MOBILE_DISKarchive-folder: /home/user/MyArchivetmp-folder: /tmp#vcs: hg#vcs: gitbin: hg: /usr/bin/hg git: /usr/bin/git tar: /bin/tar
package-name: codepackager#device-folder: /media/MY_MOBILE_DISK#archive-folder: /home/user/MyArchive#tmp-folder: /tmpvcs: hg#vcs: git#bin:# hg: /usr/bin/hg# git: /usr/bin/git# tar: /bin/tar
Repository Setting(%REPO%/.codepackager.yaml)
Local Setting(~/.codepackager.yaml)
![Page 14: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/14.jpg)
14
Command
■ prep_codepkg.py
● Archive repository to mobile storage
● Require presence of repository setting
■ recv_codepkg.py [ARCHIVE_FILE_PATH]
● Pull/Fetch changes from mobile storage
● Specify path to archive file if repository setting not available yet■ Useful for bringing in setting file
![Page 15: CodePackager - Pack and Unpack repositories to mobile storage](https://reader033.fdocuments.net/reader033/viewer/2022052910/559b72701a28abf3388b45d9/html5/thumbnails/15.jpg)
15
Thank you !
http://goo.gl/BgRBNGet source code: