xixi178 пре 7 месеци
родитељ
комит
7f2620da48

+ 21 - 0
.drone.yml

@@ -0,0 +1,21 @@
+kind: pipeline # 定义对象类型,还有secret和signature两种类型
+type: docker # 定义流水线类型,还有kubernetes、exec、ssh等类型
+name: test_drone # 定义流水线名称
+
+steps: # 定义流水线执行步骤,这些步骤将顺序执行
+  - name: build-package # 流水线名称
+    image: maven:3.6.3-jdk-8 # 定义创建容器的Docker镜像
+    volumes: # 将容器内目录挂载到宿主机,仓库需要开启Trusted设置
+      - name: maven-build
+        path: /root/testDrone # 将应用打包好的Jar和执行脚本挂载出来
+    commands:
+      - $MAVEN_HOME/bin/mvn -v
+      - $MAVEN_HOME/bin/mvn clean package -DskipTests=true
+      # 将打包后的jar包,拷贝到 /root/testDrone 目录
+      - cp target/*.jar  /root/testDrone
+
+
+volumes: # 定义流水线挂载目录,用于共享数据
+  - name: maven-build
+    host:
+      path: /root/testDrone   #jar包目录可以修改从宿主机中挂载的目录

+ 6 - 0
sp-com/sp-admin/Dockerfile

@@ -0,0 +1,6 @@
+FROM registry.cn-shenzhen.aliyuncs.com/mogu-zh/jdk:8-mogu-alpine
+ENV LANG C.UTF-8
+ENV TZ Asia/Shanghai
+VOLUME /tmp
+ADD TestDrone-1.0-SNAPSHOT.jar TestDrone-1.0-SNAPSHOT.jar
+ENTRYPOINT ["java","-Xms256m","-Xmx256m","-jar","/TestDrone-1.0-SNAPSHOT.jar"]

+ 6 - 0
sp-com/sp-core/Dockerfile

@@ -0,0 +1,6 @@
+FROM registry.cn-shenzhen.aliyuncs.com/mogu-zh/jdk:8-mogu-alpine
+ENV LANG C.UTF-8
+ENV TZ Asia/Shanghai
+VOLUME /tmp
+ADD TestDrone-1.0-SNAPSHOT.jar TestDrone-1.0-SNAPSHOT.jar
+ENTRYPOINT ["java","-Xms256m","-Xmx256m","-jar","/TestDrone-1.0-SNAPSHOT.jar"]

+ 6 - 0
sp-com/sp-more/Dockerfile

@@ -0,0 +1,6 @@
+FROM registry.cn-shenzhen.aliyuncs.com/mogu-zh/jdk:8-mogu-alpine
+ENV LANG C.UTF-8
+ENV TZ Asia/Shanghai
+VOLUME /tmp
+ADD TestDrone-1.0-SNAPSHOT.jar TestDrone-1.0-SNAPSHOT.jar
+ENTRYPOINT ["java","-Xms256m","-Xmx256m","-jar","/TestDrone-1.0-SNAPSHOT.jar"]

+ 6 - 0
sp-com/sp-start/Dockerfile

@@ -0,0 +1,6 @@
+FROM registry.cn-shenzhen.aliyuncs.com/mogu-zh/jdk:8-mogu-alpine
+ENV LANG C.UTF-8
+ENV TZ Asia/Shanghai
+VOLUME /tmp
+ADD TestDrone-1.0-SNAPSHOT.jar TestDrone-1.0-SNAPSHOT.jar
+ENTRYPOINT ["java","-Xms256m","-Xmx256m","-jar","/TestDrone-1.0-SNAPSHOT.jar"]

+ 1 - 1
sp-server/src/main/resources/application-dev.yml

@@ -8,7 +8,7 @@ spring:
         type: com.alibaba.druid.pool.DruidDataSource
         url: jdbc:mysql://127.0.0.1:3306/sp-dev?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
         username: root
-        password: root123456 
+        password:
         # 是否打开sql监控台  (生产环境请务必关闭此选项) 
         druid: 
             stat-view-servlet: