annotate fabfile.py @ 13:30bb8acb77a4

Updated to v0.5.4p5, use repository dependencies.
author lparsons
date Tue, 05 Nov 2013 13:02:43 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
1 from fabric.api import local
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
2 from fabric.operations import prompt
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
3 import os
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
4
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
5
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
6 def package():
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
7 '''
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
8 Pacakge for upload to toolshed
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
9 packaging 'test' version (default) uses local directory
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
10 otherwise, specify a mercurial tag to package
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
11 '''
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
12 package_dir = 'package'
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
13 base_filename = os.path.join(package_dir, 'htseq-count')
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
14 version = prompt("Enter version number for package [test]:")
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
15 revision_option = ''
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
16 if version != '':
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
17 revision_option = '-r "%s"' % version
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
18 else:
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
19 version = 'test'
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
20 version_filename = '%s_%s.tar.gz' % (base_filename, version)
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
21 local('mkdir -p %s' % package_dir)
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
22 local('rm -f %s' % version_filename)
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
23 if version == 'test':
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
24 local('tar czvf %s --exclude "fabfile.*" --exclude "%s" --exclude ".hg*" *' % (version_filename, package_dir))
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
25 else:
30bb8acb77a4 Updated to v0.5.4p5, use repository dependencies.
lparsons
parents:
diff changeset
26 local('hg archive -t tgz %s -X "fabfile.*" -X "package" -X ".hg*" -p . "%s"' % (revision_option, version_filename))