devz howto II

devz Howto





Get devz
$ git clone https://github.com/ipduh/devz.git
$ cd devz


Install devz as root
$ su
# ./install_devz_as_root.sh
# source ~/.bashrc


Install devz for a user
# exit
$ ./install_devz_as_user.sh
$ source ~/.bashrc


Configure devz
  • 1) Copy public SSH key to remote system(s)
  • 2) Adjust ~/.devzconfig/production-servers
1) Create SSH key pair and copy the public key to a remote "production" server.
$ ssh-keygen -t dsa
$ scp ~/.ssh/id_dsa.pub production_server:~/.ssh/authorized_keys2
2) An example ~/.devzconfig/production-servers
# production servers
# IP address , SSH TCP port, user
192.0.2.22,44,usar
192.0.2.23,22,usar


Use devz

Initialize SSH agent.
$ devz-setagent


Stor
$ stor blah
devz:The directory ./stor does not exist! I will create it.
devz:blah is at ./stor/blah.0


Toprod
$ toprod blah 
devz:/home/usar/blah to usar@192.0.2.22:44:/home/usar/blah
blah                                                                                                          100%    6     0.0KB/s   00:00  
devz:/home/usar/blah to usar@192.0.2.23:22:/home/usar/blah
blah                                                                                                          100%    6     0.0KB/s   00:00


Ctoprod
$ ctoprod "cat blah"
devz: usar@192.0.2.22:44 "cat blah"
***Start 192.0.2.22***
blah

***End 192.0.2.22***
devz: usar@192.0.2.23:22 
***Start 192.0.2.23***
blah

***End 192.0.2.23***


Fromprod
$ fromprod blah
devz:blah exists! Please stor it and delete it or rename it.
$ rm blah
$ fromprod blah
devz:ipduh@192.0.2.22:44:/home/usar/blah to /hom/usar/blah
blah                                                                                                          100%    6     0.0KB/s 00:00                                       


get help-cheatsheet
$ devz
******
devz
DEVeloper'S Stupid Servant.
A bash extention that helps the administrator of similar dev and production systems.
g0 2010 - http://ipduh.com/contact
http://sl.ipduh.com/devz-howto
******
devz verbs:
*
'toprod' or 'devz toprod'
 toprod file
 scp a file to the production server(s)
*
'ctoprod' or 'devz ctoprod'
 ctoprod 'command;command;'
 send command(s) to poduction server(s)
*
'fromprod' or 'devz fromprod'
 fromprod file
 scp a file from the first production server here.
*
'stor' or 'devz stor'
 stor file
 creates the directory stor in the current directory if it does not exist.
 makes a copy of the file in stor
 the file gets a version number like file.n where n [0,n]
*
'devz-setagent' or 'devz setagent'
 setagent
 start an ssh-agent login session
*
'devz-showconfig' or 'devz showconfig'
 showconfig
 See the Current devz configuration
*
'devz-setconfig' or 'devz setconfig'
 setconfig
 add server to the production-servers list file
 setconfig cannot configure much, check the devz-howto for your first setup
*
'devz-prodsrvexists' or 'devz prodsrvexists'
 prodsrvexists
 check if ${DEVZ_PRO_SRV} exists and  print an example ${DEVZ_PRO_SRV} file
*
******





devz-howto