diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-02-11 15:45:06 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-02-11 15:45:06 +0900 |
commit | 3533b7020a6ee89e8de51aea3ffc0a9b5524c4b7 (patch) | |
tree | 525febce5bb2f6efea25e5c11f8a5d29a42ecb2d | |
parent | 0af8892a267e9d7f4534c25c1d27feab7ddb9563 (diff) | |
download | ybd-encode-repo-url.tar.gz |
Encode the expanded repo url in the saved target yamlencode-repo-url
This is useful for external tools to operate on the generated yaml
-rw-r--r-- | ybd/cache.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ybd/cache.py b/ybd/cache.py index 12ee8f4..c838269 100644 --- a/ybd/cache.py +++ b/ybd/cache.py @@ -54,8 +54,11 @@ def cache_key(dn): key = 'no-build' if app.config.get('mode', 'normal') in ['keys-only', 'normal']: - if dn.get('repo') and not dn.get('tree'): - dn['tree'], dn['sha'] = get_tree(dn) + if dn.get('repo'): + if not dn.get('tree'): + dn['tree'], dn['sha'] = get_tree(dn) + if not dn.get('repourl'): + dn['repourl'] = get_repo_url(dn.get('repo')) factors = hash_factors(dn) factors = json.dumps(factors, sort_keys=True).encode('utf-8') key = hashlib.sha256(factors).hexdigest() |