mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-07 07:50:28 +03:00
Merge branch 'collection-of-fixes' into 'master'
include fdroidserverid in build log post on wiki See merge request !201
This commit is contained in:
commit
1993cc874d
3 changed files with 21 additions and 14 deletions
|
|
@ -1200,15 +1200,18 @@ def main():
|
||||||
failed_apps[appid] = e
|
failed_apps[appid] = e
|
||||||
wikilog = str(e)
|
wikilog = str(e)
|
||||||
|
|
||||||
if wikilog:
|
|
||||||
wikilog = tools_version_log + '\n\n' + wikilog
|
|
||||||
|
|
||||||
if options.wiki and wikilog:
|
if options.wiki and wikilog:
|
||||||
try:
|
try:
|
||||||
# Write a page with the last build log for this version code
|
# Write a page with the last build log for this version code
|
||||||
lastbuildpage = appid + '/lastbuild_' + build.vercode
|
lastbuildpage = appid + '/lastbuild_' + build.vercode
|
||||||
newpage = site.Pages[lastbuildpage]
|
newpage = site.Pages[lastbuildpage]
|
||||||
txt = "Build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + "\n\n" + wikilog
|
with open(os.path.join('tmp', 'fdroidserverid')) as fp:
|
||||||
|
fdroidserverid = fp.read()
|
||||||
|
txt = "* build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + '\n' \
|
||||||
|
+ '* fdroidserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
|
||||||
|
+ fdroidserverid + ' ' + fdroidserverid + ']\n\n' \
|
||||||
|
+ tools_version_log + '\n\n' \
|
||||||
|
+ '== Build Log ==\n\n' + wikilog
|
||||||
newpage.save(txt, summary='Build log')
|
newpage.save(txt, summary='Build log')
|
||||||
# Redirect from /lastbuild to the most recent build log
|
# Redirect from /lastbuild to the most recent build log
|
||||||
newpage = site.Pages[appid + '/lastbuild']
|
newpage = site.Pages[appid + '/lastbuild']
|
||||||
|
|
|
||||||
|
|
@ -565,7 +565,8 @@ def scan_repo_files(apkcache, repodir, knownapks, use_date_from_file=False):
|
||||||
usecache = True
|
usecache = True
|
||||||
else:
|
else:
|
||||||
logging.debug("Ignoring stale cache data for " + name)
|
logging.debug("Ignoring stale cache data for " + name)
|
||||||
elif not usecache:
|
|
||||||
|
if not usecache:
|
||||||
logging.debug("Processing " + name)
|
logging.debug("Processing " + name)
|
||||||
repo_file = {}
|
repo_file = {}
|
||||||
# TODO rename apkname globally to something more generic
|
# TODO rename apkname globally to something more generic
|
||||||
|
|
@ -960,8 +961,8 @@ def extract_pubkey():
|
||||||
return hexlify(pubkey)
|
return hexlify(pubkey)
|
||||||
|
|
||||||
|
|
||||||
def make_index(apps, sortedids, apks, repodir, archive, categories):
|
def make_index(apps, sortedids, apks, repodir, archive):
|
||||||
"""Make a repo index.
|
"""Generate the repo index files.
|
||||||
|
|
||||||
:param apps: fully populated apps list
|
:param apps: fully populated apps list
|
||||||
:param apks: full populated apks list
|
:param apks: full populated apks list
|
||||||
|
|
@ -1296,7 +1297,9 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
|
||||||
iconfilename = os.path.join(icon_dir, os.path.basename(config['repo_icon']))
|
iconfilename = os.path.join(icon_dir, os.path.basename(config['repo_icon']))
|
||||||
shutil.copyfile(config['repo_icon'], iconfilename)
|
shutil.copyfile(config['repo_icon'], iconfilename)
|
||||||
|
|
||||||
# Write a category list in the repo to allow quick access...
|
|
||||||
|
def make_categories_txt(repodir, categories):
|
||||||
|
'''Write a category list in the repo to allow quick access'''
|
||||||
catdata = ''
|
catdata = ''
|
||||||
for cat in categories:
|
for cat in categories:
|
||||||
catdata += cat + '\n'
|
catdata += cat + '\n'
|
||||||
|
|
@ -1611,7 +1614,7 @@ def main():
|
||||||
appdict = dict()
|
appdict = dict()
|
||||||
appdict[appid] = app
|
appdict[appid] = app
|
||||||
if os.path.isdir(repodir):
|
if os.path.isdir(repodir):
|
||||||
make_index(appdict, [appid], apks, repodir, False, categories)
|
make_index(appdict, [appid], apks, repodir, False)
|
||||||
else:
|
else:
|
||||||
logging.info('Skipping index generation for ' + appid)
|
logging.info('Skipping index generation for ' + appid)
|
||||||
return
|
return
|
||||||
|
|
@ -1620,12 +1623,13 @@ def main():
|
||||||
archive_old_apks(apps, apks, archapks, repodirs[0], repodirs[1], config['archive_older'])
|
archive_old_apks(apps, apks, archapks, repodirs[0], repodirs[1], config['archive_older'])
|
||||||
|
|
||||||
# Make the index for the main repo...
|
# Make the index for the main repo...
|
||||||
make_index(apps, sortedids, apks, repodirs[0], False, categories)
|
make_index(apps, sortedids, apks, repodirs[0], False)
|
||||||
|
make_categories_txt(repodirs[0], categories)
|
||||||
|
|
||||||
# If there's an archive repo, make the index for it. We already scanned it
|
# If there's an archive repo, make the index for it. We already scanned it
|
||||||
# earlier on.
|
# earlier on.
|
||||||
if len(repodirs) > 1:
|
if len(repodirs) > 1:
|
||||||
make_index(apps, sortedids, archapks, repodirs[1], True, categories)
|
make_index(apps, sortedids, archapks, repodirs[1], True)
|
||||||
|
|
||||||
if config['update_stats']:
|
if config['update_stats']:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class ImportTest(unittest.TestCase):
|
||||||
fdroidserver.common.fill_config_defaults(config)
|
fdroidserver.common.fill_config_defaults(config)
|
||||||
fdroidserver.common.config = config
|
fdroidserver.common.config = config
|
||||||
|
|
||||||
url = 'https://gitlab.com/eighthave/ci-test-app'
|
url = 'https://gitlab.com/fdroid/ci-test-app'
|
||||||
r = requests.head(url)
|
r = requests.head(url)
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
print("ERROR", url, 'unreachable (', r.status_code, ')')
|
print("ERROR", url, 'unreachable (', r.status_code, ')')
|
||||||
|
|
@ -42,8 +42,8 @@ class ImportTest(unittest.TestCase):
|
||||||
app.UpdateCheckMode = "Tags"
|
app.UpdateCheckMode = "Tags"
|
||||||
root_dir, src_dir = import_proxy.get_metadata_from_url(app, url)
|
root_dir, src_dir = import_proxy.get_metadata_from_url(app, url)
|
||||||
self.assertEqual(app.RepoType, 'git')
|
self.assertEqual(app.RepoType, 'git')
|
||||||
self.assertEqual(app.WebSite, 'https://gitlab.com/eighthave/ci-test-app')
|
self.assertEqual(app.WebSite, 'https://gitlab.com/fdroid/ci-test-app')
|
||||||
self.assertEqual(app.Repo, 'https://gitlab.com/eighthave/ci-test-app.git')
|
self.assertEqual(app.Repo, 'https://gitlab.com/fdroid/ci-test-app.git')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue