OSDN Git Service

newslash-test-container: update BUILD files
authorhylom <hylom@users.sourceforge.jp>
Mon, 3 Oct 2016 13:43:30 +0000 (22:43 +0900)
committerhylom <hylom@users.sourceforge.jp>
Mon, 3 Oct 2016 13:43:30 +0000 (22:43 +0900)
newslash-test-container/BUILD
newslash-test-container/entrypoint.sh [new file with mode: 0644]
newslash-test-container/test_container.sh [new file with mode: 0755]

index 7125aa2..1598fbe 100644 (file)
@@ -4,7 +4,7 @@ genrule(
     name = "jessie_mojolicious",
     srcs = [
       "Dockerfile",
-      "newslash.cnf"
+      "newslash.cnf",
     ],
     outs = ["jessie_mojolicious.tar"],
     cmd = "pushd $$(dirname $(location Dockerfile)) && docker build -t osdn/jessie_mojolicious . && popd && docker save osdn/jessie_mojolicious > $@",
@@ -16,6 +16,11 @@ docker_build(
     base = ":jessie_mojolicious",
     ports = ["80"],
     debs = ["//debian:newslash-deb"],
+    files = ["entrypoint.sh"],
+    mode = "0755",
     repository = "osdn",
+    visibility = ["//visibility:public"],
+    cmd = ["newslash_web"],
+    entrypoint = ["/entrypoint.sh"],
 )
 
diff --git a/newslash-test-container/entrypoint.sh b/newslash-test-container/entrypoint.sh
new file mode 100644 (file)
index 0000000..a11a42c
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -eo pipefail
+
+TARGET=/usr/share/newslash/script/newslash_web
+if [ "$1" = "newslash_web" ]; then
+    shift;
+    exec $TARGET "$@"
+elif [ "$1" = "daemon" ]; then
+    exec $TARGET "$@"
+elif [ "$1" = "test" ]; then
+    exec $TARGET "$@"
+else
+    exec "$@"
+fi
diff --git a/newslash-test-container/test_container.sh b/newslash-test-container/test_container.sh
new file mode 100755 (executable)
index 0000000..8a24ede
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+docker run -ti --link compose_srad-db_1:sd-db -v $(pwd)/test.json:/usr/share/newslash/newslash-web.json osdn/newslash-test-container:jessie test "$@"
+
+