From: hylom Date: Mon, 20 Aug 2018 09:45:53 +0000 (+0900) Subject: test-container: cleanup scripts X-Git-Tag: v0.1.5~80 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8098e5980ba322d582d2eed25508243e568192ef;p=newslash%2Fnewslash.git test-container: cleanup scripts --- diff --git a/test-container/BUILD b/test-container/BUILD deleted file mode 100644 index 1598fbe8..00000000 --- a/test-container/BUILD +++ /dev/null @@ -1,26 +0,0 @@ -load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build") - -genrule( - name = "jessie_mojolicious", - srcs = [ - "Dockerfile", - "newslash.cnf", - ], - outs = ["jessie_mojolicious.tar"], - cmd = "pushd $$(dirname $(location Dockerfile)) && docker build -t osdn/jessie_mojolicious . && popd && docker save osdn/jessie_mojolicious > $@", - local = 1, -) - -docker_build( - name = "jessie", - 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/test-container/Dockerfile b/test-container/Dockerfile index 7f048133..e3ca29b6 100644 --- a/test-container/Dockerfile +++ b/test-container/Dockerfile @@ -22,6 +22,9 @@ RUN apt-get install -y libdate-calc-perl libdatetime-perl liburi-perl libjson-pe RUN apt-get install -y pylucene python-mysql.connector liblucene4.10-java libasm-java RUN apt-get install -y python-yaml +# for develop +RUN apt-get install -y libdevel-nytprof-perl + # install custom pylucene package COPY files/$PYLUCENE_DEB /tmp RUN dpkg -i /tmp/$PYLUCENE_DEB @@ -29,5 +32,3 @@ RUN dpkg -i /tmp/$PYLUCENE_DEB COPY files/newslash.cnf /etc/mysql/conf.d/ EXPOSE 80 -# for develop -RUN apt-get install -y libdevel-nytprof-perl diff --git a/test-container/Dockerfile_jessie b/test-container/Dockerfile_jessie deleted file mode 100644 index 39c9374a..00000000 --- a/test-container/Dockerfile_jessie +++ /dev/null @@ -1,18 +0,0 @@ -FROM debian:jessie -MAINTAINER hirom@osdn.jp - -RUN apt-get update -y -RUN apt-get install -y vim-nox lv less -RUN apt-get install -y libmojolicious-perl libjs-bootstrap libdbd-mysql libdbi-perl \ - libdbd-mysql-perl libtemplate-perl node-less libcrypt-openssl-random-perl \ - libemail-valid-perl tinymce libredis-perl libhtml-tidy-perl liburi-perl \ - libyaml-perl libdatetime-format-mysql-perl - -# slash's dependency -RUN apt-get install -y libdate-calc-perl libdatetime-perl liburi-perl libjson-perl \ - libcache-memcached-fast-perl libdata-javascript-anon-perl libwww-perl - -COPY files/newslash.cnf /etc/mysql/conf.d/ - -EXPOSE 80 - diff --git a/test-container/Dockerfile_k8s b/test-container/Dockerfile_k8s index 505d56cf..b2f0297d 100644 --- a/test-container/Dockerfile_k8s +++ b/test-container/Dockerfile_k8s @@ -1,23 +1,4 @@ -FROM debian:stretch -ENV PYLUCENE_DEB=python-lucene_4.10.1+osdn-1_amd64.deb - -# install basic packages -RUN apt-get update -y -RUN apt-get install -y vim-nox lv less - -# install mojolicious related packages -RUN apt-get install -y libmojolicious-perl libjs-bootstrap libdbd-mysql libdbi-perl \ - libdbd-mysql-perl libtemplate-perl node-less libcrypt-openssl-random-perl \ - libemail-valid-perl tinymce libredis-perl libhtml-tidy-perl liburi-perl \ - libyaml-perl libdatetime-format-mysql-perl libdatetime-format-iso8601-perl \ - libxml-feed-perl libcarp-always-perl libcrypt-eksblowfish-perl - -# install slash's dependency -RUN apt-get install -y libdate-calc-perl libdatetime-perl liburi-perl libjson-perl \ - libcache-memcached-fast-perl libdata-javascript-anon-perl libwww-perl - -# install python and lucene packages -RUN apt-get install -y pylucene python-mysql.connector liblucene4.10-java libasm-java python-yaml +FROM newslash-base:latest # install jenkins related packaged RUN apt-get install -y openjdk-8-jdk openssh-server @@ -25,10 +6,6 @@ EXPOSE 22 COPY files/jenkins.pub /root/.ssh/authorized_keys RUN chmod 600 /root/.ssh/authorized_keys -# install custom pylucene package -COPY files/$PYLUCENE_DEB /tmp -RUN dpkg -i /tmp/$PYLUCENE_DEB - # copy config file COPY files/newslash.cnf /etc/mysql/conf.d/ diff --git a/test-container/Makefile b/test-container/Makefile new file mode 100644 index 00000000..1eed9a31 --- /dev/null +++ b/test-container/Makefile @@ -0,0 +1,17 @@ +TAG_NAME=newslash-base +HOST_NAME= sdtest.osdn.co.jp:5000 + +build-base: Dockerfile files + docker build $(DOCKER_OPTS) -t newslash-base . + +build-k8s-test: + docker build -f Dockerfile_k8s $(DOCKER_OPTS) -t $(HOST_NAME)/osdn/newslash-test . + +build-searchd-base: Dockerfile_for_searchd + docker build -f Dockerfile_for_searchd $(DOCKER_OPTS) -t ns_searchd . + +push: + docker push $(HOST_NAME)/osdn/newslash-test + +run-newslash-dev: + kubectl apply -f k8s-newslash-dev.yaml diff --git a/test-container/build.sh b/test-container/build.sh deleted file mode 100755 index b0d1448b..00000000 --- a/test-container/build.sh +++ /dev/null @@ -1 +0,0 @@ -docker build -t stretch_mojolicious . diff --git a/test-container/k8s-newslash-pod.yaml b/test-container/k8s-newslash.yaml similarity index 100% rename from test-container/k8s-newslash-pod.yaml rename to test-container/k8s-newslash.yaml diff --git a/test-container/k8s-ns-searchd-svc.yaml b/test-container/k8s-ns-searchd-svc.yaml deleted file mode 100644 index b05fd267..00000000 --- a/test-container/k8s-ns-searchd-svc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: ns-searchd -spec: - clusterIP: 10.254.100.110 - type: ClusterIP - ports: - - port: 6000 - protocol: TCP - name: ns-searchd - selector: - app: ns-searchd diff --git a/test-container/newslash-web.yaml b/test-container/newslash-web.yaml deleted file mode 100644 index f6cd79fc..00000000 --- a/test-container/newslash-web.yaml +++ /dev/null @@ -1,156 +0,0 @@ ---- -BasicAuth: - enable: 0 - username: '' - password: '' - message: test server - -hypnotoad: - listen: - - https://*:8000?cert=/var/certs/live/sdtest.osdn.co.jp/cert.pem&key=/var/certs/live/sdtest.osdn.co.jp/privkey.pem - -Site: - name: sdtest - root: "/" - base_url: http://sdtest.osdn.co.jp:3000 - description: yet another news site - img_path: "/img" - css_path: "/css" - topic_icon_base_url: "/img/topic_icon" - -ReCaptcha: - site_key: 6LcPlyIUAAAAAN2d4Gw4q2DWLtFCDYmn5tSVqS3w - secret_key: 6LcPlyIUAAAAAIlTdXjw3tIz_U-lUwW45RudOXfR - -ACL: - exclude: ["^/img/", "^/css/", "^/js/", "^/static/", "^/login", "^/logout", "^/banned"] - -Search: - searchd_host: ns_searchd - searchd_port: 6000 - -Polls: - TTL: 730 - TTL_unit: "days" - vote_cooling_seconds: 300 - -CSSCompile: - source_dir: css - dest_dir: public/css - lessc: "/usr/bin/lessc" - -QuasiStaticContent: - targets: - css/main.css: - source: css/main.less - type: less - css/bootstrap.css: - source: css/bootstrap.less - type: less - less: - command: /usr/bin/lessc - content-type: text/css - options: - - include-path: ./css - - "-" - -JavaScriptLoader: - source_directory: public/js - mode: production - -FeedFetcher: - fetch_timeout: 5 -# http_proxy: -# https_proxy: - -System: - secret_key: secret strings for hasing - session_store: kvs - salt: '' - readonly: 0 - -Repository: - path: /var/newslash/repository - -Log: - #debug: 1 - access_log: /var/log/newslash/access.log - #local_file: 1 - #level: debug - #system_log: /tmp/newslash.log - backtrace: 0 - -Analytics: - tag: "UA-739864-18" - -Story: - title_max_byte: 100 - -IndexPage: - story_per_page: 10 - -Timeline: - popular_period: { years: 2 } - item_per_page: 20 - -Database: - host: sd-db - name: slash - user: slash - password: hoge - -MemoryCache: - test_mode: 0 - -KeyValueStore: - type: redis - host: newslash-redis:6379 - test_mode: 0 - -Legacy: - memcached: sd-master:11211 - -Faculties: - comments: - 1000: [ipid, subnetid] - metamoderations: - 1000: [uid] - moderations: - 1000: [ipid subnetid uid m2uid] - stories: - 1000: [hits hitparade] - submissions: - 1000: [ipid subnetid note comment] - -Editor: - allowed_tags: - b: [] - i: [] - p: [] - br: [] - a: - - href - ol: - - start - ul: [] - li: [] - dl: [] - dt: [] - dd: [] - em: [] - strong: [] - tt: [] - blockquote: - - title - - cite - div: [] - ecode: [] - del: [] - ins: [] - sub: [] - sup: [] - quote: [] - strike: [] - -Hsts: -# redirect_non_ssl: 1 diff --git a/test-container/old_run_scripts/build.sh b/test-container/old_run_scripts/build.sh new file mode 100755 index 00000000..cca54727 --- /dev/null +++ b/test-container/old_run_scripts/build.sh @@ -0,0 +1 @@ +docker build $@ -t stretch_mojolicious . diff --git a/test-container/build_for_jenkins.sh b/test-container/old_run_scripts/build_for_jenkins.sh similarity index 84% rename from test-container/build_for_jenkins.sh rename to test-container/old_run_scripts/build_for_jenkins.sh index 6a1b317e..44c3be1e 100755 --- a/test-container/build_for_jenkins.sh +++ b/test-container/old_run_scripts/build_for_jenkins.sh @@ -1 +1 @@ -docker build -f Dockerfile_for_jenkins -t stretch_mojolicious_runtest . +docker build -f Dockerfile_for_jenkins -t stretch_mojolicious_runtest $@ . diff --git a/test-container/build_for_searchd.sh b/test-container/old_run_scripts/build_for_searchd.sh similarity index 100% rename from test-container/build_for_searchd.sh rename to test-container/old_run_scripts/build_for_searchd.sh diff --git a/test-container/skaffold-ns-searchd.yaml b/test-container/old_run_scripts/skaffold-ns-searchd.yaml similarity index 100% rename from test-container/skaffold-ns-searchd.yaml rename to test-container/old_run_scripts/skaffold-ns-searchd.yaml diff --git a/test-container/skaffold.yaml b/test-container/old_run_scripts/skaffold.yaml similarity index 100% rename from test-container/skaffold.yaml rename to test-container/old_run_scripts/skaffold.yaml