From 6cf956a8eef53662d05356ac11f46de68d3e603d Mon Sep 17 00:00:00 2001 From: Paul Sherwood Date: Sun, 13 Mar 2016 15:03:32 +0000 Subject: [PATCH] New mode: [keys-only, no-build, normal] --- .gitlab-ci.yml | 4 +--- readme.md | 2 +- ybd/__main__.py | 2 ++ ybd/assembly.py | 2 +- ybd/cache.py | 2 +- ybd/config/ybd.conf | 1 + 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 916b634..f0596cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,5 @@ image: devcurmudgeon/foo -services: - before_script: - sh ./install.sh @@ -25,4 +23,4 @@ check_installation: check_cache_keys: stage: cache_keys - script: "echo 'base: /src' > ./ybd.conf && ../ybd/ybd.py ci x86_64" + script: "echo 'mode: keys-only' > ./ybd.conf && ../ybd/ybd.py ci x86_64" diff --git a/readme.md b/readme.md index 6bab362..fba57e9 100644 --- a/readme.md +++ b/readme.md @@ -162,7 +162,7 @@ config values you may want to override include: log-elapsed: True # log elapsed times since start, or actual time log-verbose: False # log extra info including all sandbox installation steps min-gigabytes: 10 # space required by ybd. artifacts are culled to free this - no-build: False # for testing/debugging ybd - if True, only run the assembly logic, don't compile things + mode: ['keys-only', 'no-build', 'normal'] # for testing/debugging ybd reproduce: False # if True, build and compare against artifacts on server schemas: # files defining schemas for definitions (currently schemas/*) schema-validation: False # set to True to warn, 'strict' to exit on error diff --git a/ybd/__main__.py b/ybd/__main__.py index 1c1d785..4e4bb9a 100755 --- a/ybd/__main__.py +++ b/ybd/__main__.py @@ -51,6 +51,8 @@ defs = Definitions() with app.timer('CACHE-KEYS', 'cache-key calculations'): cache.cache_key(defs, app.config['target']) + if app.config.get('mode', 'normal') == 'keys-only': + os._exit(0) cache.cull(app.config['artifacts']) target = defs.get(app.config['target']) diff --git a/ybd/assembly.py b/ybd/assembly.py index af6c00a..31b37de 100644 --- a/ybd/assembly.py +++ b/ybd/assembly.py @@ -120,7 +120,7 @@ def run_build(defs, this): been assembled. ''' - if app.config.get('no-build'): + if app.config.get('mode', 'normal') == 'no-build': app.log(this, 'SKIPPING BUILD: artifact will be empty') return diff --git a/ybd/cache.py b/ybd/cache.py index 0c9198a..77157d2 100644 --- a/ybd/cache.py +++ b/ybd/cache.py @@ -54,7 +54,7 @@ def cache_key(defs, this): factors = hash_factors(defs, definition) factors = json.dumps(factors, sort_keys=True).encode('utf-8') key = hashlib.sha256(factors).hexdigest() - if app.config.get('no-build'): + if app.config.get('mode', 'normal') == 'no-build': key = 'no-build' definition['cache'] = definition['name'] + "." + key diff --git a/ybd/config/ybd.conf b/ybd/config/ybd.conf index 694cb38..a6f34a6 100644 --- a/ybd/config/ybd.conf +++ b/ybd/config/ybd.conf @@ -21,6 +21,7 @@ kbas-password: 'insecure' log-elapsed: True log-verbose: False min-gigabytes: 10 +mode: 'normal' no-ccache: False no-distcc: True schemas: