Skip to content
Snippets Groups Projects
Commit 7914baa4 authored by Georges Racinet's avatar Georges Racinet
Browse files

build-launch: removed all build capability

The builds now happen entirely in Heptapod CI/CD
parent 98527213
No related branches found
No related tags found
No related merge requests found
......@@ -197,26 +197,8 @@
`full_tag` is actually the full name of the image, with the tag part.
Examples: `octobus/heptapod:testing`
"""
with open(os.path.join(context_dir, 'heptapod_revisions.json')) as jsonf:
revisions = json.load(jsonf)
prepare_sources(context_dir, revisions, shares_dir, simulate=simulate)
py_version_tag = py_version_image_tag(full_tag, py_version)
cmd = ['docker', 'build', '-t', py_version_tag]
if no_cache:
cmd.extend(('--pull', '--no-cache'))
if squash:
cmd.append('--squash')
cmd.extend(docker_build_args(py_version))
cmd.append(context_dir)
print("%s: %r" % (msg, cmd))
if not simulate:
subprocess.check_call(cmd)
if py_version == DEFAULT_PYTHON_VERSION:
cmd = ('docker', 'tag', py_version_tag, full_tag)
print("%s: %r" % (msg, cmd))
if not simulate:
subprocess.check_call(cmd)
print()
raise NotImplementedError("As of Heptapod 0.17.0, local building does "
"not make sense any more")
def retag_partial_image(full_tag,
......@@ -307,14 +289,9 @@
run_group.add_argument('--container-name', default='heptapod')
img_group = parser.add_argument_group("Docker image options")
img_group.add_argument('--no-build', action='store_true',
help="Don't build any image. This has precedence "
"over --build-base-image. Together with "
"--image-tag, can be used, e.g, to test the "
"base %r image" % BASE_IMAGE_TAG)
img_group.add_argument('--no-cache', action='store_true',
help="Build image(s) without cache.")
img_group.add_argument('--image-tag',
help="Tag for the produced and/or run image. "
"The default %r is suitable "
"for --push" % DEFAULT_IMAGE_TAG)
......@@ -315,13 +292,9 @@
img_group.add_argument('--no-cache', action='store_true',
help="Build image(s) without cache.")
img_group.add_argument('--image-tag',
help="Tag for the produced and/or run image. "
"The default %r is suitable "
"for --push" % DEFAULT_IMAGE_TAG)
img_group.add_argument('--build-base-image', action="store_true",
help="Build or rebuild the base Heptapod image %r "
"upon which this "
"development image is based." % BASE_IMAGE_TAG)
img_group.add_argument('--squash', action="store_true",
help="If True and the base image is to be built, "
"use `docker build --squash` to build the base "
......@@ -341,9 +314,7 @@
log_vol = expand_join(parsed_args.volumes_dir, parsed_args.volume_logs)
src_vol = os.path.expanduser(parsed_args.volume_src)
do_build_dev = not parsed_args.no_build and not parsed_args.base
do_build_base = not parsed_args.no_build and (
parsed_args.build_base_image or parsed_args.base)
do_build_dev = do_build_base = False
do_push = parsed_args.push
do_run = not parsed_args.no_run
......@@ -381,40 +352,6 @@
shares_dir = parsed_args.src_shares_dir
if do_build_base:
if py_version == '3':
retag_partial_image(BASE_IMAGE_TAG,
pull=no_cache,
simulate=simulate)
else:
build_image(BASE_IMAGE_TAG,
os.path.join(OMNIBUS_DIR, 'heptapod'),
no_cache=no_cache,
shares_dir=shares_dir,
squash=bool(parsed_args.squash),
py_version=py_version,
simulate=simulate,
msg="Docker base image build command")
if do_push:
push_image(py_version_tag, simulate=simulate)
if py_version == DEFAULT_PYTHON_VERSION:
push_image(BASE_IMAGE_TAG, simulate=simulate)
if do_build_dev:
if py_version != DEFAULT_PYTHON_VERSION:
sys.stderr.write("Sorry, building dev image is available only "
"for the default --python-version=%r at the "
"time being\n" % DEFAULT_PYTHON_VERSION)
sys.exit(1)
build_image(image_tag, DOCKER_CONTEXT_DIR,
shares_dir=shares_dir,
simulate=simulate,
py_version=py_version,
no_cache=no_cache)
if do_push:
push_image(image_tag, py_version, simulate=simulate)
if not do_run:
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment