aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ci/docker/Makefile
diff options
context:
space:
mode:
authorMatthewLi <matthew.lijun@huawei.com>2016-05-23 21:32:49 -0400
committerMatthewLi <matthew.lijun@huawei.com>2016-05-23 21:35:08 -0400
commitfdc0a62eb8fc92bcc0de1c65beda00c667cfcffb (patch)
treef9c1a9193607214c07b2020b84c9fbbfd6c6a1bf /tests/ci/docker/Makefile
parent1476937d9be4c04d7f9f1d224c76cb9380a74bc9 (diff)
move /ci into /tests directory
JIRA: YARDSTICK-269 Change-Id: I2b552aded888fa9d8f8ddd8d902b3d7f6d31a607 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
Diffstat (limited to 'tests/ci/docker/Makefile')
-rw-r--r--tests/ci/docker/Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/ci/docker/Makefile b/tests/ci/docker/Makefile
new file mode 100644
index 000000000..036d67db3
--- /dev/null
+++ b/tests/ci/docker/Makefile
@@ -0,0 +1,36 @@
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+SHELL = /bin/bash
+
+IMAGE = opnfv/yardstick
+
+DOCKER_TAG = brahmaputra.0
+
+.PHONY: all
+all: .docker
+
+.docker:
+ /usr/bin/docker build --rm=true --no-cache=true -t $(IMAGE):$(DOCKER_TAG) yardstick-ci
+ /usr/bin/docker tag -f $(IMAGE):$(DOCKER_TAG) $(IMAGE):latest
+ touch .docker
+
+
+.PHONY: clean
+clean:
+ @docker ps | grep $(IMAGE) | awk '{print $$1}' | xargs -r docker stop
+ @docker ps -a | grep $(IMAGE) | awk '{print $$1}' | xargs -r docker rm
+ @echo "Docker images to remove:"
+ @docker images | head -1 && docker images | grep $(IMAGE) || true
+ @image_tags=($$(docker images | grep $(IMAGE) | awk '{print $$2}')) ; \
+ for tag in "$${image_tags[@]}"; do \
+ echo "Removing docker image $(IMAGE):$$tag..." ; \
+ docker rmi $(IMAGE):$$tag ; \
+ done
+ rm -f .docker