Skip to content

Commit

Permalink
New mode: [keys-only, no-build, normal]
Browse files Browse the repository at this point in the history
  • Loading branch information
devcurmudgeon committed Mar 13, 2016
1 parent ef2cd4d commit 6cf956a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
image: devcurmudgeon/foo

services:

before_script:
- sh ./install.sh

Expand All @@ -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"
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ybd/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion ybd/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ybd/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ybd/config/ybd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6cf956a

Please sign in to comment.