Kaynağa Gözat

Merge branch 'master' of http://gogs.ieasou.cn/ecom/cif-cdp

root 3 yıl önce
ebeveyn
işleme
352ce62c19
2 değiştirilmiş dosya ile 91 ekleme ve 29 silme
  1. 90 0
      .drone.yml
  2. 1 29
      Dockerfile

+ 90 - 0
.drone.yml

@@ -0,0 +1,90 @@
+kind: pipeline
+type: kubernetes
+name: cif-cdp
+
+clone:
+  disable: true
+
+metadata:
+  namespace: drone
+
+steps:
+ - name: clone
+   image: hub.evbj.easou.com/dev/alpine-git:20200622
+   commands:
+   - git clone --depth=1 $DRONE_GIT_HTTP_URL .
+
+ - name: build
+   image: plugins/docker
+   settings:
+     username: admin
+     password: Easou2)1*
+     insecure: true
+     mirror: https://ci7pm4nx.mirror.aliyuncs.com
+     registry: hub.evbj.easou.com
+     repo: hub.evbj.easou.com/oldad/${DRONE_REPO_NAME}
+     tag: v1.0.1
+     
+ - name: deployment
+   image: hub.evbj.easou.com/dev/drone-agent:v2.0.0
+   pull: always
+   # privileged: true
+   environment:
+     JNLP_ENV: oldad
+     JNLP_REPLICAS: 1
+     JNLP_TAG: v1.0.1
+     JNLP_VERSION: v1  # default v1, v2 for canary
+     DEPLOY_ENV: k8s-2 # 可以选择把应用部署到集群:k8s-1 or k8s-2
+     JNLP_REPO: hub.evbj.easou.com
+     JNLP_CONTAINER_PORT: 8080
+     JNLP_INGRESS: nginx
+     JNLP_SVC_MODE: http
+     JNLP_STORAGE_CLASS: rbd
+     JNLP_DOMAIN: .ieasou.cn
+     JNLP_CONTROL: StatefulSet
+     JNLP_STORAGE_CAPACITY: 200Gi
+     JNLP_MOUNT_PATH: /data
+     JNLP_LIVENESS_INIT: 90
+     JNLP_LIVENESS_PER: 15
+     JNLP_READINESS_INIT: 90
+     JNLP_READINESS_PER: 15
+     JNLP_INGRESS_PUB: no
+   commands:
+     # 切换目标集群
+     - kubecm s $DEPLOY_ENV
+     # 生成配置YAML文件
+     - python3 /root/tools.py -b
+     # 部署服务到kubernetes上
+     - python3 /root/tools.py -a
+     # 检查服务部署状态
+     - python3 /root/tools.py -c
+     # 添加dns解析记录,生成访问域名
+     #- python3 /root/tools.py -d
+
+ - name: success
+   image: hub.evbj.easou.com/dev/drone-wechat:20200622
+   settings:
+     corpid: ww419ee4063735e1c0
+     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
+     agent_id: 1000004
+     title: "Pipeline ${DRONE_REPO_NAME} Success"
+     description: "${DRONE_BUILD_LINK} 部署完成"
+     msg_url: ${DRONE_BUILD_LINK}
+     btn_txt: "否"
+   when:
+     status:
+     - success
+
+ - name: failure
+   image: hub.evbj.easou.com/dev/drone-wechat:20200622
+   settings:
+     corpid: ww419ee4063735e1c0
+     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
+     agent_id: 1000004
+     title: "Pipeline ${DRONE_REPO_NAME} Failure"
+     description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
+     msg_url: ${DRONE_BUILD_LINK}
+     btn_txt: "否"
+   when:
+     status:
+     - failure

+ 1 - 29
Dockerfile

@@ -1,29 +1 @@
-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
-
-COPY cifcdp.ini /etc/supervisord.d/cifcdp.ini
-COPY entrypoint.sh /usr/bin/entrypoint.sh
-COPY startup.sh /app/ecom/fsync164/startup.sh
-
-ENTRYPOINT ["entrypoint.sh"]
-CMD ["supervisord"]
+FROM hub.evbj.easou.com/oldad/cif-cdp:v1.0.0