28
from offspring import config
28
from offspring.config import get_configuration
29
29
from offspring.master.models import Release
31
config = get_configuration()
31
33
def publish_tree(src, dst):
32
34
names = os.listdir(src)
44
46
# Do not publish development signatures.
46
48
elif (srcname.endswith('sums.txt') and
47
os.path.exists(config.publisher("signer_script"))):
49
os.path.exists(config.get('publisher', "signer_script"))):
48
50
# Copy file into signer files directory.
51
os.path.join(config.publisher("signer_files"), name))
53
os.path.join(config.get('publisher', "signer_files"), name))
52
54
# Execute the signer script to have files signed.
53
os.system(config.publisher("signer_script"))
55
os.system(config.get('publisher', "signer_script"))
54
56
# Remove the file we copied into the signer directory.
56
os.path.join(config.publisher("signer_files"), name))
58
os.path.join(config.get('publisher', "signer_files"), name))
57
59
# Move the signed file to the destination.
60
config.publisher("signer_results"), "%s.asc" % name
62
config.get('publisher', "signer_results"), "%s.asc" % name
61
63
), "%s.asc" % dstname)
62
64
shutil.copyfile(srcname, dstname)
65
database = create_database(config.publisher("db"))
67
database = create_database(config.get('publisher', "db"))
66
68
store = Store(database)
67
69
for release in store.find(Release,
68
70
Release.status == Release.STATUS_PENDING):
71
73
(release.name, release.build.project))
73
75
images_directory = "%s/images" % release.build.result_directory(
74
base_dir=config.publisher('development_pool'))
76
base_dir=config.get('publisher', 'development_pool'))
75
77
project_directory = "%s/project" % release.build.result_directory(
76
base_dir=config.publisher('development_pool'))
78
base_dir=config.get('publisher', 'development_pool'))
77
79
release_directory = release.result_directory(
78
base_dir=config.publisher('production_pool'))
80
base_dir=config.get('publisher', 'production_pool'))
80
82
if os.path.exists(images_directory):