Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyrex.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ confversion = @CONFVERSION@
# repository
%buildlocal = 0

# If both buildlocal and norebuild are set to 1 pyrex will not attempt to
# rebuild and update an already built docker image. Useful if you are offline
# and your current image is good enough.
%norebuild = 0

# A list of environment variables that should be imported as Pyrex
# configuration variables in the "env" section, e.g. ${env:HOME}. Note that
# environment variables accessed in this way must be set or an error will
Expand Down
9 changes: 6 additions & 3 deletions pyrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ def build_image(config, build_config):
.rstrip()
)
else:
subprocess.check_call(engine_args, env=env)
if config["config"]["norebuild"] != "1":
subprocess.check_call(engine_args, env=env)
build_config["build"]["buildid"] = get_image_id(config, tag)

build_config["build"]["runid"] = build_config["build"]["buildid"]

except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
print(e, file=sys.stderr)
return None

build_config["build"]["buildhash"] = get_build_hash(build_config)
Expand All @@ -267,7 +269,8 @@ def build_image(config, build_config):
subprocess.check_call(engine_args)

build_config["build"]["buildid"] = get_image_id(config, tag)
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
print(e, file=sys.stderr)
return None

build_config["build"]["runid"] = tag
Expand Down