mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Also upload binaries to backup server
This commit is contained in:
parent
72aa1ee196
commit
791f5c2325
@ -23,8 +23,10 @@ DOWNLOADS = '/srv/main/downloads'
|
||||
HTML2LRF = "calibre/ebooks/lrf/html/demo"
|
||||
TXT2LRF = "src/calibre/ebooks/lrf/txt/demo"
|
||||
STAGING_HOST = 'download.calibre-ebook.com'
|
||||
STAGING_USER = 'root'
|
||||
BACKUP_HOST = 'code.calibre-ebook.com'
|
||||
STAGING_USER = BACKUP_USER = 'root'
|
||||
STAGING_DIR = '/root/staging'
|
||||
BACKUP_DIR = '/binaries'
|
||||
|
||||
|
||||
def installers(include_source=True):
|
||||
@ -123,11 +125,21 @@ def get_fosshub_data():
|
||||
|
||||
def send_data(loc):
|
||||
subprocess.check_call([
|
||||
'rsync', '--inplace', '--delete', '-r', '-zz', '-h', '--progress', '-e',
|
||||
'rsync', '--inplace', '--delete', '-r', '-zz', '-h', '--info=progress2', '-e',
|
||||
'ssh -x', loc + '/', '%s@%s:%s' % (STAGING_USER, STAGING_HOST, STAGING_DIR)
|
||||
])
|
||||
|
||||
|
||||
def send_to_backup(loc):
|
||||
host = f'{BACKUP_USER}@{BACKUP_HOST}'
|
||||
dest = f'{BACKUP_DIR}/{__version__}'
|
||||
subprocess.check_call(['ssh', '-x', host, 'mkdir', '-p', dest])
|
||||
subprocess.check_call([
|
||||
'rsync', '--inplace', '--delete', '-r', '-zz', '-h', '--info=progress2', '-e',
|
||||
'ssh -x', loc + '/', f'{host}:{dest}/'
|
||||
])
|
||||
|
||||
|
||||
def gh_cmdline(ver, data):
|
||||
return [
|
||||
__appname__, ver, 'fmap', 'github', __appname__, data['username'],
|
||||
@ -282,6 +294,15 @@ class UploadInstallers(Command): # {{{
|
||||
else:
|
||||
break
|
||||
|
||||
while True:
|
||||
try:
|
||||
send_to_backup(tdir)
|
||||
except:
|
||||
print('\nUpload to backup failed, retrying in a minute')
|
||||
time.sleep(60)
|
||||
else:
|
||||
break
|
||||
|
||||
def upload_to_github(self, replace):
|
||||
data = get_github_data()
|
||||
args = gh_cmdline(__version__, data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user