Skip to content

Commit

Permalink
Improvements to fabfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Monson committed Dec 4, 2015
1 parent 93c3904 commit e3b8402
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
8 changes: 7 additions & 1 deletion doc/PDB2PQR Release SOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ In the file <code>site_scons/defaults.py</code> change the value of <code>produc
## Fabric
All of the steps in the Build, Binary builds and Automated Testing can be done automatically for all target platforms by adapting fabric_settings.py and using the fabric.py script found in the pdb2pqr directory. Documentation for the python fabric module and how to use the fabric script can be found at http://docs.fabfile.org/

Use the command "fabric doall" on a Windows machine to build and test pdb2pqr on all target platforms.
Build the documentation.

Use the command "fab build_all_binaries" on a Windows machine to build and test pdb2pqr on all target platforms.

If all tests pass and all binaries are built then restore fabric_settings.py to it's default state. Run "fab build_all_tarballs"

After these steps all 3 binary tarballs, the source tarball and the source tarball for NBCR will all be in "dist_file" directory.

## Build
The branch should be tested to see if it configures and compiles correctly on all the target operating systems.
Expand Down
20 changes: 16 additions & 4 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ def pack():
tar.add('apbs_libs/osx/_apbslib.so','pdb2pka/_apbslib.so')
tar.close()

@runs_once
def pack_for_nbcr():
tar = start_src_tar('pdb2pqr-src-'+pv+'.tar.gz', 'pdb2pqr-src-'+pv)
create_dist_folder()
tar = start_src_tar('pdb2pqr-src-nbcr-'+pv+'.tar.gz', 'pdb2pqr-src-'+pv)
tar.add('apbs_libs/linux/apbslib.py','pdb2pka/apbslib.py')
tar.add('apbs_libs/linux/_apbslib.so','pdb2pka/_apbslib.so')
tar.close()
local("move pdb2pqr-src-nbcr-"+pv+'.tar.gz dist_files/')

def start_src_tar(name='pdb2pqr.tgz', prefix=None):
file_list = local('git ls-tree -r --name-only HEAD', capture=True).split('\n')
Expand All @@ -81,9 +84,13 @@ def start_src_tar(name='pdb2pqr.tgz', prefix=None):
return tar

@runs_once
def misc():
def create_dist_folder():
with settings(warn_only=True):
local('mkdir dist_files')

@runs_once
def pack_for_ditro():
create_dist_folder()
tar = start_src_tar('pdb2pqr-src-'+pv+'.tar.gz', 'pdb2pqr-src-'+pv)
tar.close()
local('copy Changelog.md "dist_files\PDB2PQR-' + pv + '-ReleaseNotes.txt"')
Expand Down Expand Up @@ -144,6 +151,7 @@ def install_on_deployed():
run(python+' scons/scons.py install ' + configopts)

def build_binary_from_deploy():
create_dist_folder()
with cd('~/tmp/'):
os_string = 'NOT_SET_FIX_ME'
if env.host == linux_host:
Expand Down Expand Up @@ -218,11 +226,15 @@ def build_windows_binary():
zip_file.write(real_file_path, zip_file_path)
print 'Zipping ' + zip_file_path
zip_file.close()
create_dist_folder()
local('mv ' + name + '.zip' + ' dist_files/' + name + '.zip')


def doall():
misc()
def build_all_tarballs():
pack_for_ditro()
pack_for_nbcr()

def build_all_binaries():
pack()
deploy()
build_binary_from_deploy()
Expand Down

0 comments on commit e3b8402

Please sign in to comment.