15
1 CodePackager Pack and Unpack repositories to mobile storage Speaker: Vincent CY Liao Date: 2013-06-27

CodePackager - Pack and Unpack repositories to mobile storage

Embed Size (px)

Citation preview

Page 1: CodePackager - Pack and Unpack repositories to mobile storage

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

2

Outline

■ Problem

■ CodePackager

● Configuration

● Command

Page 3: CodePackager - Pack and Unpack repositories to mobile storage

3

Problem

■ Problem

■ Old Solution

Page 4: CodePackager - Pack and Unpack repositories to mobile storage

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

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

6

Boring

Page 7: CodePackager - Pack and Unpack repositories to mobile storage

7

Boring

Page 8: CodePackager - Pack and Unpack repositories to mobile storage

8

Very Boring

Page 9: CodePackager - Pack and Unpack repositories to mobile storage

9

… and human errors sometime

Such as over-written new files with old files

Page 10: CodePackager - Pack and Unpack repositories to mobile storage

10

CodePackager

■ Introduction

■ Configuration

■ Command

Page 11: CodePackager - Pack and Unpack repositories to mobile storage

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

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

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

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

15

Thank you !

http://goo.gl/BgRBNGet source code: