root 3 سال پیش
والد
کامیت
d654f47e91
6فایلهای تغییر یافته به همراه162 افزوده شده و 0 حذف شده
  1. 1 0
      .gitignore
  2. 29 0
      Dockerfile
  3. 24 0
      cifcdp.ini
  4. 71 0
      deploy-tmp.yaml
  5. 11 0
      entrypoint.sh
  6. 26 0
      epel.repo

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+s

+ 29 - 0
Dockerfile

@@ -0,0 +1,29 @@
+FROM hub.evbj.easou.com/dev/centos:7.9.2009
+
+ENV TZ=Asia/Shanghai
+ENV JAVA_HOME /usr/java/jdk1.8.0_271
+
+COPY epel.repo /etc/yum.repos.d/epel.repo
+
+RUN rm -f /etc/yum.repos.d/CentOS-* \
+    && curl -s http://mirrors.163.com/.help/CentOS7-Base-163.repo -o /etc/yum.repos.d/CentOS7-Base-163.repo \
+    && yum clean all \
+    && yum install -y supervisor \
+    && sed -i "s/nodaemon=false/nodaemon=true/" /etc/supervisord.conf \
+    && useradd ecom \
+    && mkdir -p /usr/java /app /data/ecom/{fsync164,resin8080,resin9090} /data/ecom/cif/data /data/ecom/cdp \
+    && curl -s http://10.26.22.185:9000/psop/soft/jdk1.8.0_271.tar.gz -o /tmp/jdk1.8.0_271.tar.gz \
+    && curl -s http://10.26.22.185:9000/psop/soft/ecom/ecom.tgz -o /tmp/ecom.tgz \
+    && curl -s http://10.26.22.185:9000/psop/soft/ecom/cif164.tgz -o /tmp/cif164.tgz \
+    && tar -zxf /tmp/jdk1.8.0_271.tar.gz -C /usr/java/ \
+    && tar -zxf /tmp/ecom.tgz -C /app/ \
+    && tar -zxf /tmp/cif164.tgz -C /data/ecom/ \
+    && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
+    && chown -R ecom:ecom /app /data \
+    && chmod +x /app/ecom/fsync164/startup.sh
+
+COPY cifcdp.ini /etc/supervisord.d/cifcdp.ini
+COPY entrypoint.sh /usr/bin/entrypoint.sh
+
+ENTRYPOINT ["entrypoint.sh"]
+CMD ["supervisord"]

+ 24 - 0
cifcdp.ini

@@ -0,0 +1,24 @@
+[program:fsync]
+command=/app/ecom/fsync164/startup.sh
+process_name=%(program_name)s
+startsecs=10
+startretries=3
+autostart=true
+autorestart=true
+
+[program:cdp]
+command=/app/ecom/resin9090/bin/httpd.sh
+process_name=%(program_name)s
+startsecs=30
+startretries=3
+autostart=true
+autorestart=true
+
+
+[program:cif]
+command=/app/ecom/resin8080/bin/httpd.sh
+process_name=%(program_name)s
+startsecs=30
+startretries=3
+autostart=true
+autorestart=true

+ 71 - 0
deploy-tmp.yaml

@@ -0,0 +1,71 @@
+---
+apiVersion: apps/v1
+kind: $JNLP_CONTROL
+metadata:
+  name: $DRONE_REPO_NAME
+  namespace: $JNLP_ENV
+  labels:
+    app: $DRONE_REPO_NAME
+spec:
+  serviceName: $DRONE_REPO_NAME
+  replicas: $JNLP_REPLICAS
+  selector:
+    matchLabels:
+      app: $DRONE_REPO_NAME
+  template:
+    metadata:
+      labels:
+        app: $DRONE_REPO_NAME
+    spec:
+      terminationGracePeriodSeconds: 180
+      initContainers:
+        - name: init
+          image: $JNLP_REPO/dev/busybox
+          command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
+          volumeMounts:
+          - name: volume
+            mountPath: $JNLP_MOUNT_PATH
+      containers:
+      - name: $DRONE_REPO_NAME
+        image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
+        imagePullPolicy: Always
+        ports:
+        - containerPort: $JNLP_CONTAINER_PORT
+          name: port
+        volumeMounts:
+        - name: volume
+          mountPath: $JNLP_MOUNT_PATH
+        livenessProbe:
+          tcpSocket:
+            port: $JNLP_CONTAINER_PORT
+          initialDelaySeconds: $JNLP_LIVENESS_INIT
+          periodSeconds: $JNLP_LIVENESS_PER
+        readinessProbe:
+          tcpSocket:
+            port: $JNLP_CONTAINER_PORT
+          initialDelaySeconds: $JNLP_READINESS_INIT
+          periodSeconds: $JNLP_READINESS_PER
+  volumeClaimTemplates:
+  - metadata:
+      name: volume
+    spec:
+      accessModes: ["ReadWriteOnce"]
+      storageClassName: rbd
+      resources:
+        requests:
+          storage: $JNLP_STORAGE_CAPACITY
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: $DRONE_REPO_NAME-svc
+  namespace: $JNLP_ENV
+  labels:
+    app: $DRONE_REPO_NAME-svc
+spec:
+  type: NodePort
+  ports:
+  - port: $JNLP_CONTAINER_PORT
+    targetPort: $JNLP_CONTAINER_PORT
+  selector:
+    app: $DRONE_REPO_NAME

+ 11 - 0
entrypoint.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e 
+set -o pipefail
+
+mkdir -p /data/ecom/{fsync164,resin8080,resin9090} /data/ecom/cif/data  /data/ecom/cdp
+tar -zxf /tmp/cif164.tgz -C /data/ecom/
+rm -rf /tmp/*
+chown -R ecom:ecom /app /data 
+
+exec "$@"

+ 26 - 0
epel.repo

@@ -0,0 +1,26 @@
+[epel]
+name=Extra Packages for Enterprise Linux 7 - $basearch
+baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch
+#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
+failovermethod=priority
+enabled=1
+gpgcheck=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
+
+[epel-debuginfo]
+name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
+baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug
+#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
+failovermethod=priority
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
+gpgcheck=1
+
+[epel-source]
+name=Extra Packages for Enterprise Linux 7 - $basearch - Source
+baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/SRPMS
+#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
+failovermethod=priority
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
+gpgcheck=1