Skip to content
Merged
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
3 changes: 2 additions & 1 deletion steps/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
# A future version of Cekit will expose this to us, for now we hard-code
DOCKER_API_VERSION = "1.35"

d = docker.APIClient(version=DOCKER_API_VERSION)
base_url = os.environ.get("DOCKER_HOST", docker.constants.DEFAULT_UNIX_SOCKET)
d = docker.APIClient(version=DOCKER_API_VERSION, base_url=base_url)


class ExecException(Exception):
Expand Down
4 changes: 3 additions & 1 deletion steps/image_steps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import docker


Expand All @@ -6,7 +7,8 @@
# A future version of Cekit will expose this to us, for now we hard-code
DOCKER_API_VERSION = "1.35"

DOCKER_CLIENT = docker.APIClient(version=DOCKER_API_VERSION)
base_url = os.environ.get("DOCKER_HOST", docker.constants.DEFAULT_UNIX_SOCKET)
DOCKER_CLIENT = docker.APIClient(version=DOCKER_API_VERSION, base_url=base_url)

@then(u'the image should contain label {label}')
@then(u'the image should contain label {label} {check} value {value}')
Expand Down
17 changes: 13 additions & 4 deletions steps/s2i_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@ def s2i_inner(context, application, path='.', env="", incremental=False, tag="ma
mirror = "-e 'MAVEN_MIRROR_URL=%s'" % os.getenv("MAVEN_MIRROR_URL")

image_id = "integ-" + context.image
command = "s2i build --loglevel=5 --pull-policy if-not-present %s --context-dir=%s -r=%s %s %s %s %s %s %s" % (
mirror, path, tag, env, application, context.image, image_id, "--incremental" if incremental else "",
"--runtime-image="+runtime_image if runtime_image else ""
)

command = f"""s2i build --loglevel=5 --pull-policy if-not-present\
{mirror}\
--context-dir={path}\
-r={tag}\
{env}\
{application}\
{context.image}\
{image_id}\
{"--incremental" if incremental else ""}\
{"--runtime-image="+runtime_image if runtime_image else ""}\
"""

logger.info("Executing new S2I build with the command [%s]..." % command)

success, output = _execute(command)
Expand Down