Skip to content
Snippets Groups Projects
Commit 4bcbd61b authored by Maxim Cournoyer's avatar Maxim Cournoyer
Browse files

packaging: Make interactive docker targets really interactive.

* scripts/make-packaging-target.py (DOCKER_EXTRA_ARGS): New
variable. It defaults to "-i" when running interactive targets.

Change-Id: I097b68222ab9805535f50840ce182da858aa51c7
parent 5c50e195
No related branches found
No related tags found
No related merge requests found
# -*- mode: makefile; -*-
# Copyright (C) 2016-2017 Savoir-faire Linux Inc. # Copyright (C) 2016-2017 Savoir-faire Linux Inc.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
......
...@@ -37,8 +37,9 @@ target_template = """\ ...@@ -37,8 +37,9 @@ target_template = """\
# names, just about the contents of the Dockerfile. # names, just about the contents of the Dockerfile.
PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME:=ring-packaging-%(distribution)s$(RING_PACKAGING_IMAGE_SUFFIX) PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME:=ring-packaging-%(distribution)s$(RING_PACKAGING_IMAGE_SUFFIX)
PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE:=.docker-image-$(PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME) PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE:=.docker-image-$(PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME)
DOCKER_EXTRA_ARGS =
PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND:= docker run \\ PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND = docker run \\
--rm \\ --rm \\
-e RELEASE_VERSION=$(RELEASE_VERSION) \\ -e RELEASE_VERSION=$(RELEASE_VERSION) \\
-e RELEASE_TARBALL_FILENAME=$(RELEASE_TARBALL_FILENAME) \\ -e RELEASE_TARBALL_FILENAME=$(RELEASE_TARBALL_FILENAME) \\
...@@ -48,7 +49,8 @@ PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND:= docker run \\ ...@@ -48,7 +49,8 @@ PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND:= docker run \\
-e DISTRIBUTION=%(distribution)s \\ -e DISTRIBUTION=%(distribution)s \\
-v $(CURDIR):/opt/ring-project-ro:ro \\ -v $(CURDIR):/opt/ring-project-ro:ro \\
-v $(CURDIR)/packages/%(distribution)s:/opt/output \\ -v $(CURDIR)/packages/%(distribution)s:/opt/output \\
-t $(PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME) -t $(DOCKER_EXTRA_ARGS) \\
$(PACKAGE_%(distribution)s_DOCKER_IMAGE_NAME)
$(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE): docker/Dockerfile_%(distribution)s $(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE): docker/Dockerfile_%(distribution)s
docker build \\ docker build \\
...@@ -68,6 +70,7 @@ packages/%(distribution)s/%(output_file)s: $(RELEASE_TARBALL_FILENAME) packages/ ...@@ -68,6 +70,7 @@ packages/%(distribution)s/%(output_file)s: $(RELEASE_TARBALL_FILENAME) packages/
package-%(distribution)s: packages/%(distribution)s/%(output_file)s package-%(distribution)s: packages/%(distribution)s/%(output_file)s
.PHONY: package-%(distribution)s-interactive .PHONY: package-%(distribution)s-interactive
package-%(distribution)s-interactive: DOCKER_EXTRA_ARGS = -i
package-%(distribution)s-interactive: $(RELEASE_TARBALL_FILENAME) packages/%(distribution)s $(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE) package-%(distribution)s-interactive: $(RELEASE_TARBALL_FILENAME) packages/%(distribution)s $(PACKAGE_%(distribution)s_DOCKER_IMAGE_FILE)
$(PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND) bash $(PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND) bash
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment