From cda03f7e0d7f1de3f1194f186e4d75377c4f8c02 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Tue, 2 May 2017 12:38:27 +0100 Subject: [PATCH] Makefile: Use the name provided to upload in run This fixes an issue introduced in the split of push and run. Before this commit, an image could be pushed to a custom location from the presence of the `CLOUDSDK_IMAGE_NAME` variable. The subsquent run would fail as the name `test-ltp` or `test` had been hard coded in the Make target. We now use a target-specific variable which is only set if there is not an existing variable in the environment Signed-off-by: Dave Tucker --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa3730449..6a32055de 100644 --- a/Makefile +++ b/Makefile @@ -58,9 +58,10 @@ test-hyperkit: $(LINUXKIT) test-initrd.img test-bzImage test-cmdline $(call check_test_log, test.log) .PHONY: test-gcp +test-gcp: export CLOUDSDK_IMAGE_NAME?=test test-gcp: $(LINUXKIT) test.img.tar.gz $(LINUXKIT) push gcp test.img.tar.gz - $(LINUXKIT) run gcp test | tee test-gcp.log + $(LINUXKIT) run gcp $(CLOUDSDK_IMAGE_NAME) | tee test-gcp.log $(call check_test_log, test-gcp.log) .PHONY: test @@ -72,9 +73,10 @@ test-ltp.img.tar.gz: $(MOBY) test/ltp/test-ltp.yml $(MOBY) build --pull test/ltp/test-ltp.yml .PHONY: test-ltp +test-ltp: export CLOUDSDK_IMAGE_NAME?=test-ltp test-ltp: $(LINUXKIT) test-ltp.img.tar.gz $(LINUXKIT) push gcp test-ltp.img.tar.gz - $(LINUXKIT) run gcp -skip-cleanup -machine n1-highcpu-4 test-ltp | tee test-ltp.log + $(LINUXKIT) run gcp -skip-cleanup -machine n1-highcpu-4 $(CLOUDSDK_IMAGE_NAME) | tee test-ltp.log $(call check_test_log, test-ltp.log) .PHONY: ci ci-tag ci-pr