From 0f5ac75de1b56b338a4ff90b15cdc490357a1005 Mon Sep 17 00:00:00 2001
From: Patrick Uiterwijk <puiterwijk@redhat.com>
Date: Mar 27 2017 21:19:13 +0000
Subject: [PATCH 1/2] Add quickrun container


Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>

---

diff --git a/Makefile b/Makefile
index 98faf04..aaecb74 100644
--- a/Makefile
+++ b/Makefile
@@ -144,6 +144,16 @@ releaserpms: rpmroot rpmdistdir sdist
 	mv $(RPMBUILD)/SRPMS/ipsilon-*.src.rpm dist/srpms/
 	rm -rf $(RPMBUILD)
 
+# Running within containers
+container-quickrun:
+	echo "Building quickrun container ..."
+	(cat tests/containers/Dockerfile-base tests/containers/Dockerfile-dev tests/containers/Dockerfile-fedora tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/fedora:latest/' | docker build -f - -t ipsilon-quickrun -
+	echo "quickrun container built"
+
+quickrun: container-quickrun
+	echo "Starting Quickrun ..."
+	docker run -v `pwd`:/code -t --rm -it ipsilon-quickrun
+
 # Testing within containers
 container-centos7:
 	echo "Building CentOS 7 container ..."
diff --git a/tests/containers/Dockerfile-dev b/tests/containers/Dockerfile-dev
new file mode 100644
index 0000000..43a4f17
--- /dev/null
+++ b/tests/containers/Dockerfile-dev
@@ -0,0 +1,3 @@
+RUN mkdir /tmp/workdir \
+    && chown testuser:testuser /tmp/workdir
+ENTRYPOINT ["./quickrun.py", "--workdir", "/tmp/workdir", "--cleanup"]

From 4fa670e317d033d27b7821e8a27d14b8dd119fbd Mon Sep 17 00:00:00 2001
From: Patrick Uiterwijk <puiterwijk@redhat.com>
Date: Mar 27 2017 21:19:33 +0000
Subject: [PATCH 2/2] Remove other sudo commands


Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>

---

diff --git a/Makefile b/Makefile
index aaecb74..3593447 100644
--- a/Makefile
+++ b/Makefile
@@ -157,17 +157,17 @@ quickrun: container-quickrun
 # Testing within containers
 container-centos7:
 	echo "Building CentOS 7 container ..."
-	(cat tests/containers/Dockerfile-base tests/containers/Dockerfile-centos tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/centos:7/' | sudo docker build -f - -q -t ipsilon-centos7 -
+	(cat tests/containers/Dockerfile-base tests/containers/Dockerfile-centos tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/centos:7/' | docker build -f - -q -t ipsilon-centos7 -
 	echo "CentOS 7 container built"
 
 container-fedora24:
 	echo "Building Fedora 24 container ..."
-	(cat tests/containers/Dockerfile-base tests/containers/Dockerfile-fedora tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/fedora:24/' | sudo docker build -f - -q -t ipsilon-fedora24 -
+	(cat tests/containers/Dockerfile-base tests/containers/Dockerfile-fedora tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/fedora:24/' | docker build -f - -q -t ipsilon-fedora24 -
 	echo "Fedora 24 container built"
 
 container-fedora25:
 	echo "Building Fedora 25 container ..."
-	(cat tests/containers/Dockerfile-base tests/containers/Dockerfile-fedora tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/fedora:25/' | sudo docker build -f - -q -t ipsilon-fedora25 -
+	(cat tests/containers/Dockerfile-base tests/containers/Dockerfile-fedora tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/fedora:25/' | docker build -f - -q -t ipsilon-fedora25 -
 	echo "Fedora 25 container built"
 
 containers: container-fedora24 container-fedora25
@@ -175,22 +175,22 @@ containers: container-fedora24 container-fedora25
 
 containertest-centos7: container-centos7
 	echo "Starting CentOS 7 tests ..."
-	sudo docker run -v `pwd`:/code -t --rm -a stderr ipsilon-centos7
+	docker run -v `pwd`:/code -t --rm -a stderr ipsilon-centos7
 	echo "CentOS 7 passed"
 
 containertest-fedora24: container-fedora24
 	echo "Starting Fedora 24 tests ..."
-	sudo docker run -v `pwd`:/code -t --rm -a stderr ipsilon-fedora24
+	docker run -v `pwd`:/code -t --rm -a stderr ipsilon-fedora24
 	echo "Fedora 24 passed"
 
 containertest-fedora25: container-fedora25
 	echo "Starting Fedora 25 tests ..."
-	sudo docker run -v `pwd`:/code -t --rm -a stderr ipsilon-fedora25
+	docker run -v `pwd`:/code -t --rm -a stderr ipsilon-fedora25
 	echo "Fedora 25 passed"
 
 containertest-lint: container-fedora25
 	echo "Starting code lint tests ..."
-	sudo docker run -v `pwd`:/code -t --rm -a stderr --entrypoint /usr/bin/make ipsilon-fedora25 lint pep8
+	docker run -v `pwd`:/code -t --rm -a stderr --entrypoint /usr/bin/make ipsilon-fedora25 lint pep8
 	echo "Code lint tests passed"
 
 containertest: containertest-lint containertest-centos7 containertest-fedora24 containertest-fedora25

