Various minor fixes in the publish process

This commit is contained in:
Kovid Goyal 2013-06-28 12:26:56 +05:30
parent 837adb4eab
commit 6579327a6d
3 changed files with 16 additions and 4 deletions

View File

@ -35,3 +35,13 @@ rsync /srv from another file server
service nginx start service nginx start
Services
---------
SSH into sourceforge and downloadbestsoftware so that their host keys are
stored.
ssh -oStrictHostKeyChecking=no kovid@www.downloadbestsoft-mirror1.com
ssh -oStrictHostKeyChecking=no kovidgoyal,calibre@frs.sourceforge.net
ssh -oStrictHostKeyChecking=no files.calibre-ebook.com (and whatever other mirrors are present)

View File

@ -473,14 +473,18 @@ def upload_to_servers(files, version): # {{{
os.mkdir(dest) os.mkdir(dest)
for src in files: for src in files:
shutil.copyfile(src, os.path.join(dest, os.path.basename(src))) shutil.copyfile(src, os.path.join(dest, os.path.basename(src)))
generate_index() cwd = os.getcwd()
try:
generate_index()
finally:
os.chdir(cwd)
for server, rdir in {'files':'/srv/download/'}.iteritems(): for server, rdir in {'files':'/srv/download/'}.iteritems():
print('Uploading to server:', server) print('Uploading to server:', server)
server = '%s.calibre-ebook.com' % server server = '%s.calibre-ebook.com' % server
# Copy the generated index files # Copy the generated index files
print ('Copying generated index') print ('Copying generated index')
check_call(['rsync', '-hzr', '-e', 'ssh -x', '--include', '*.html', check_call(['rsync', '-hza', '-e', 'ssh -x', '--include', '*.html',
'--filter', '-! */', base, 'root@%s:%s' % (server, rdir)]) '--filter', '-! */', base, 'root@%s:%s' % (server, rdir)])
# Copy the release files # Copy the release files
rdir = '%s%s/' % (rdir, version) rdir = '%s%s/' % (rdir, version)

View File

@ -255,8 +255,6 @@ class UploadToServer(Command): # {{{
description = 'Upload miscellaneous data to calibre server' description = 'Upload miscellaneous data to calibre server'
def run(self, opts): def run(self, opts):
check_call('ssh divok rm -f %s/calibre-\*.tar.xz'%DOWNLOADS, shell=True)
# check_call('scp dist/calibre-*.tar.xz divok:%s/'%DOWNLOADS, shell=True)
check_call('gpg --armor --detach-sign dist/calibre-*.tar.xz', check_call('gpg --armor --detach-sign dist/calibre-*.tar.xz',
shell=True) shell=True)
check_call('scp dist/calibre-*.tar.xz.asc divok:%s/signatures/'%DOWNLOADS, check_call('scp dist/calibre-*.tar.xz.asc divok:%s/signatures/'%DOWNLOADS,