util/docker: Unify local build targets

Add a `docker-run-local` target that is used as a template for the
local build targets (`docker-build-coreboot`, `docker-abuild`, and
`docker-what-jenkins-does`).

Note this changes the user for `docker-what-jenkins-does` which has
(ccache) issues if it's not `root`. Will be fixed in a follow-up.

Change-Id: I9088fb9211726cddc37b17ddf70170c2c382679e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/29456
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Nico Huber 2018-11-04 17:26:14 +01:00 committed by Patrick Georgi
parent 271b8a5f81
commit 674ed24075
1 changed files with 12 additions and 18 deletions

View File

@ -95,29 +95,23 @@ docker-cleanall:
$(DOCKER) rmi $$($(DOCKER) images | grep -v "REPOSITORY" | tr -s ' ' | cut -f3 -d ' '); \ $(DOCKER) rmi $$($(DOCKER) images | grep -v "REPOSITORY" | tr -s ' ' | cut -f3 -d ' '); \
fi fi
docker-build-coreboot: test-docker docker-run-local: test-docker
$(DOCKER) run -u root -it -v $(top):/home/coreboot/coreboot \ $(DOCKER) run -u root -it -v $(top):/home/coreboot/coreboot \
--user $(UID):$(GID) \ --user $(UID):$(GID) \
--rm coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \ --rm coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \
/bin/bash -c "cd /home/coreboot/coreboot && \ /bin/bash -c "cd /home/coreboot/coreboot && $(DOCKER_RUN_LOCAL)"
make clean && \
make $(BUILD_CMD); \
rm .xcompile"
docker-abuild: test-docker docker-build-coreboot: docker-run-local
$(DOCKER) run -u root -it -v $(top):/home/coreboot/coreboot \ docker-build-coreboot: override DOCKER_RUN_LOCAL := \
--user $(UID):$(GID) \ make clean && make $(BUILD_CMD); rm -f .xcompile
--rm coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \
/bin/bash -c "cd /home/coreboot/coreboot && \
make clean && \
util/abuild/abuild $(ABUILD_ARGS); \
rm -f .xcompile"
docker-what-jenkins-does: test-docker docker-abuild: docker-run-local
$(DOCKER) run -u root -it -v $(top):/home/coreboot/coreboot \ docker-abuild: override DOCKER_RUN_LOCAL := \
--rm coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \ make clean && util/abuild/abuild $(ABUILD_ARGS); rm -f .xcompile
/bin/bash -c "cd /home/coreboot/coreboot && \
make clean && make what-jenkins-does CPUS=$(CPUS)" docker-what-jenkins-does: docker-run-local
docker-what-jenkins-does: override DOCKER_RUN_LOCAL := \
make clean && make what-jenkins-does CPUS=$(CPUS)
docker-jenkins-server: test-docker docker-jenkins-server: test-docker
@if [ ! -d "$(COREBOOT_JENKINS_CACHE_DIR)" ]; then \ @if [ ! -d "$(COREBOOT_JENKINS_CACHE_DIR)" ]; then \