move from active to all

This commit is contained in:
kjeld Schouten-Lebbing 2022-01-19 20:46:10 +01:00
parent 3ec93d5b69
commit 2c1c0a7a79
No known key found for this signature in database
GPG Key ID: 4CDAD4A532BC1EDB
2 changed files with 7 additions and 6 deletions

View File

@ -20,5 +20,6 @@ Additional options are available:
- `trueupdate -h` for the CLI help page
- `trueupdate -s` or ` trueupdate --sync` to sync the catalogs before running auto-update
- `trueupdate -p` or ` trueupdate --prune` to prune (remove) old docker images after running auto-update
- `trueupdate -a` or ` trueupdate --all` updates both active (running) and non-active (stuck or stopped) Apps
- `trueupdate --catalog CATALOGNAME` where CATALOGNAME is the name of the catalog you want to process in caps
- `trueupdate --versioning SCHEME` where SCHEME is the highest semver version you want to process. options: `patch`, `minor` and `major`

View File

@ -51,7 +51,7 @@ def check_semver(current: str, latest: str):
def execute_upgrades():
if ACTIVE:
if ALL:
if CATALOG == "ALL":
filtered = filter(lambda a: a.update_available and a.status == "active", INSTALLED_CHARTS)
else:
@ -88,13 +88,13 @@ def process_args():
global VERSIONING
global SYNC
global PRUNE
global ACTIVE
global ALL
parser = argparse.ArgumentParser(description='Update TrueNAS SCALE Apps')
parser.add_argument('--catalog', nargs='?', default='ALL', help='name of the catalog you want to process in caps. Or "ALL" to render all catalogs.')
parser.add_argument('--versioning', nargs='?', default='minor', help='Name of the versioning scheme you want to update. Options: major, minor or patch. Defaults to minor')
parser.add_argument('-s', '--sync', action="store_true", help='sync catalogs before trying to update')
parser.add_argument('-p', '--prune', action="store_true", help='prune old docker images after update')
parser.add_argument('-a', '--active', action="store_true", help='update "active" apps only and ignore "stopped" or "stuck" apps')
parser.add_argument('-a', '--all', action="store_true", help='update "active" apps only and ignore "stopped" or "stuck" apps')
args = parser.parse_args()
CATALOG = args.catalog
VERSIONING = args.versioning
@ -106,10 +106,10 @@ def process_args():
PRUNE = True
else:
PRUNE = False
if args.active:
ACTIVE = True
if args.all:
ALL = True
else:
ACTIVE = False
ALL = False
def sync_catalog():
if SYNC: