Merge pull request #38 from cgeoffroy/pr-bootsrap_ci
authorpeusterm <manuel.peuster@uni-paderborn.de>
Mon, 7 Mar 2016 18:26:19 +0000 (19:26 +0100)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Mon, 7 Mar 2016 18:26:19 +0000 (19:26 +0100)
Bootstrap son-emu CI

.gitignore
utils/ci/build_01_unit_tests.sh [new file with mode: 0755]
utils/ci/build_02_integration_tests.sh [new file with mode: 0755]
utils/ci/junit-xml/.gitkeep [new file with mode: 0644]
utils/docker/Dockerfile [new file with mode: 0644]
utils/docker/entrypoint.sh [new file with mode: 0755]

index 6b050ca..fc2456c 100755 (executable)
@@ -64,3 +64,6 @@ target/
 
 #Pytest
 .pytest.restart
+
+# JUnit xml
+utils/ci/junit-xml/*.xml
\ No newline at end of file
diff --git a/utils/ci/build_01_unit_tests.sh b/utils/ci/build_01_unit_tests.sh
new file mode 100755 (executable)
index 0000000..ab6ece3
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/bash -e
+set -x
+
+# Go to the 'root' directory
+SCRIPT_DIR=$(dirname $(readlink -f $0))
+BASE_DIR=$(readlink -f "${SCRIPT_DIR}/../..")
+cd ${BASE_DIR}
+
+# Remove old test output
+rm -rf utils/ci/junit-xml/*
+
+# Launch the unit testing on emuvim
+py.test -v --junit-xml=utils/ci/junit-xml/pytest_emuvim.xml src/emuvim
diff --git a/utils/ci/build_02_integration_tests.sh b/utils/ci/build_02_integration_tests.sh
new file mode 100755 (executable)
index 0000000..af027e6
--- /dev/null
@@ -0,0 +1,4 @@
+#! /bin/bash -e
+set -x
+
+son-emu-cli | grep 'Usage'
diff --git a/utils/ci/junit-xml/.gitkeep b/utils/ci/junit-xml/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/utils/docker/Dockerfile b/utils/docker/Dockerfile
new file mode 100644 (file)
index 0000000..7a9999a
--- /dev/null
@@ -0,0 +1,13 @@
+FROM cgeoffroy/dockernet
+
+WORKDIR /son-emu
+
+COPY . /son-emu/
+
+RUN cd /son-emu/ansible \
+    && ansible-playbook install.yml \
+    && cd /son-emu \
+    && python setup.py install \
+    && echo 'Done'
+
+ENTRYPOINT ["/son-emu/utils/docker/entrypoint.sh"]
diff --git a/utils/docker/entrypoint.sh b/utils/docker/entrypoint.sh
new file mode 100755 (executable)
index 0000000..580762f
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/bash -e
+set -x
+
+#cp /dockernet/util/docker/entrypoint.sh /tmp/x.sh
+#cat /tmp/x.sh | awk 'NR==1{print; print "set -x"} NR!=1' > /dockernet/util/docker/entrypoint.sh
+
+exec /dockernet/util/docker/entrypoint.sh $*