mirror of
https://github.com/CMiksche/gitea-auto-update
synced 2025-12-10 07:57:23 +01:00
* Changed structure to a Object orientated approach. * Add CLI with input for the settings file. * Added logging via file. * Added setup for publishing in pip.
33 lines
905 B
Python
33 lines
905 B
Python
'''
|
|
Gitea Auto Updater
|
|
|
|
Copyright 2018, 2019 The Gitea-Auto-Update Authors
|
|
All rights reserved.
|
|
|
|
License: GNU General Public License
|
|
'''
|
|
import logging
|
|
import configparser
|
|
import fire
|
|
from update import update
|
|
|
|
def updater(settings='settings.ini'):
|
|
# Config
|
|
config = configparser.ConfigParser()
|
|
config.read(settings)
|
|
# Create a log file
|
|
logging.basicConfig(filename=config.get('Gitea', 'logFile'), level=logging.DEBUG)
|
|
# Start update
|
|
update.Update(config.get('Gitea', 'site'),
|
|
config.get('Gitea', 'file'),
|
|
config.get('Gitea', 'sourceDir'),
|
|
config.get('Gitea', 'apiUrl'),
|
|
config.get('Gitea', 'buildFromSource'),
|
|
config.get('Gitea', 'tmpDir'),
|
|
config.get('Gitea', 'system'))
|
|
|
|
def main():
|
|
fire.Fire(updater)
|
|
|
|
if __name__ == '__main__':
|
|
main() |