Upload
cheyin-l
View
279
Download
0
Embed Size (px)
Citation preview
1
CodePackager
Pack and Unpack repositories to mobile storage
Speaker: Vincent CY LiaoDate: 2013-06-27
2
Outline
■ Problem
■ CodePackager
● Configuration
● Command
3
Problem
■ Problem
■ Old Solution
4
Production NetworkDevelopment Network
source source
Problem
■ Separated network
■ Need move code between network
● Merge bug-fixes from production network
● Backup
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
6
Boring
7
Boring
8
Very Boring
9
… and human errors sometime
Such as over-written new files with old files
10
CodePackager
■ Introduction
■ Configuration
■ Command
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 !
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
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)
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
15
Thank you !
http://goo.gl/BgRBNGet source code: