OSDN Git Service

test-container: cleanup scripts
authorhylom <hylom@users.sourceforge.jp>
Mon, 20 Aug 2018 09:45:53 +0000 (18:45 +0900)
committerhylom <hylom@users.sourceforge.jp>
Mon, 20 Aug 2018 09:45:53 +0000 (18:45 +0900)
14 files changed:
test-container/BUILD [deleted file]
test-container/Dockerfile
test-container/Dockerfile_jessie [deleted file]
test-container/Dockerfile_k8s
test-container/Makefile [new file with mode: 0644]
test-container/build.sh [deleted file]
test-container/k8s-newslash.yaml [moved from test-container/k8s-newslash-pod.yaml with 100% similarity]
test-container/k8s-ns-searchd-svc.yaml [deleted file]
test-container/newslash-web.yaml [deleted file]
test-container/old_run_scripts/build.sh [new file with mode: 0755]
test-container/old_run_scripts/build_for_jenkins.sh [moved from test-container/build_for_jenkins.sh with 84% similarity]
test-container/old_run_scripts/build_for_searchd.sh [moved from test-container/build_for_searchd.sh with 100% similarity]
test-container/old_run_scripts/skaffold-ns-searchd.yaml [moved from test-container/skaffold-ns-searchd.yaml with 100% similarity]
test-container/old_run_scripts/skaffold.yaml [moved from test-container/skaffold.yaml with 100% similarity]

diff --git a/test-container/BUILD b/test-container/BUILD
deleted file mode 100644 (file)
index 1598fbe..0000000
+++ /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"],
-)
-
index 7f04813..e3ca29b 100644 (file)
@@ -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 (file)
index 39c9374..0000000
+++ /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
-
index 505d56c..b2f0297 100644 (file)
@@ -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 (file)
index 0000000..1eed9a3
--- /dev/null
@@ -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 (executable)
index b0d1448..0000000
+++ /dev/null
@@ -1 +0,0 @@
-docker build -t stretch_mojolicious . 
diff --git a/test-container/k8s-ns-searchd-svc.yaml b/test-container/k8s-ns-searchd-svc.yaml
deleted file mode 100644 (file)
index b05fd26..0000000
+++ /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 (file)
index f6cd79f..0000000
+++ /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 (executable)
index 0000000..cca5472
--- /dev/null
@@ -0,0 +1 @@
+docker build $@ -t stretch_mojolicious . 
similarity index 84%
rename from test-container/build_for_jenkins.sh
rename to test-container/old_run_scripts/build_for_jenkins.sh
index 6a1b317..44c3be1 100755 (executable)
@@ -1 +1 @@
-docker build -f Dockerfile_for_jenkins -t stretch_mojolicious_runtest . 
+docker build -f Dockerfile_for_jenkins -t stretch_mojolicious_runtest $@