From 5e1a9023db8411005eb35ffc74d99fd5cd51e735 Mon Sep 17 00:00:00 2001 From: bob Date: Sat, 18 Mar 2023 09:00:20 +0800 Subject: [PATCH 1/4] feat(cd) add drone --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7fcc0f9..6f8a0ac 100644 --- a/.drone.yml +++ b/.drone.yml @@ -40,6 +40,6 @@ volumes: # 定义流水线挂载目录,用于共享数据 host: path: /app/maven/cache # drone执行触发器 -trigger:g +trigger: branch: - test From 7d15e59dcf9e2f5d04d34a9e4004784a8ae39ad6 Mon Sep 17 00:00:00 2001 From: bob Date: Sat, 18 Mar 2023 09:00:43 +0800 Subject: [PATCH 2/4] feat(cd) add drone --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 6f8a0ac..9ae987a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,4 +42,4 @@ volumes: # 定义流水线挂载目录,用于共享数据 # drone执行触发器 trigger: branch: - - test + - 于相涌/Lark From 35e917bb9c9ade340ab1017bd971823e4e0c018d Mon Sep 17 00:00:00 2001 From: bob Date: Sat, 18 Mar 2023 09:23:36 +0800 Subject: [PATCH 3/4] feat(cd) add drone drone --- .drone.yml | 16 ++++++++-------- ruoyi-admin/Dockerfile | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9ae987a..170c81e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,25 +1,25 @@ kind: pipeline # 定义对象类型,还有secret和signature两种类型 type: docker # 定义流水线类型,还有kubernetes、exec、ssh等类型 name: jar-deploy # 定义流水线名称 -node: - name: centos-runner steps: # 定义流水线执行步骤,这些步骤将顺序执行 - name: build-package # 流水线名称 image: maven:3.8-openjdk-11 # 定义创建容器的Docker镜像 + pull: if-not-exists volumes: # 将容器内目录挂载到宿主机,仓库需要开启Trusted设置 - name: maven-cache path: /root/.m2 # 将maven下载依赖的目录挂载出来,防止重复下载 - name: maven-build path: /app/build # 将应用打包好的Jar和执行脚本挂载出来 commands: # 定义在Docker容器中执行的shell命令 - - mvn -T 8 clean package -Dmaven.test.skip=true -pl ruoyi-admin -am # 应用打包命令 - - cp target/*.jar /app/build/ + - mvn clean package -Dmaven.test.skip=true -pl ruoyi-admin -am # 应用打包命令 + - cp ruoyi-admin/target/*.jar /app/build/ - cp ruoyi-admin/Dockerfile /app/build/Dockerfile - cp run.sh /app/build/run.sh - name: deploy-start image: appleboy/drone-ssh # SSH工具镜像 + pull: if-not-exists settings: host: 49.232.170.154 # 远程连接地址 username: root # 远程连接账号 @@ -31,7 +31,6 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行 - cd /app/build # 进入宿主机构建目录 - chmod +x run.sh # 更改为可执行脚本 - ./run.sh # 运行脚本打包应用镜像并运行 - volumes: # 定义流水线挂载目录,用于共享数据 - name: maven-build host: @@ -39,7 +38,8 @@ volumes: # 定义流水线挂载目录,用于共享数据 - name: maven-cache host: path: /app/maven/cache -# drone执行触发器 -trigger: +when: branch: - - 于相涌/Lark + - test + event: + - pull_request diff --git a/ruoyi-admin/Dockerfile b/ruoyi-admin/Dockerfile index 126ce2f..fd71385 100644 --- a/ruoyi-admin/Dockerfile +++ b/ruoyi-admin/Dockerfile @@ -6,6 +6,6 @@ ARG SPRING_PROFILE ENV JAVA_OPTS "${JAVA_OPTS} ${CUSTOM_OPTS}" -COPY target/*.jar /javarun +COPY *.jar /javarun CMD ["bash","-c","java ${JAVA_OPTS} -Dspring.profiles.active=${SPRING_PROFILE} -jar /javarun/*.jar"] From b7a8c4ab8f2025a2170692f5753ef0b0e50b2467 Mon Sep 17 00:00:00 2001 From: bob Date: Sat, 18 Mar 2023 09:38:39 +0800 Subject: [PATCH 4/4] feat(log) change log file --- ruoyi-admin/src/main/resources/logback.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/resources/logback.xml b/ruoyi-admin/src/main/resources/logback.xml index 5184d9b..31ae0a3 100644 --- a/ruoyi-admin/src/main/resources/logback.xml +++ b/ruoyi-admin/src/main/resources/logback.xml @@ -36,7 +36,7 @@ 60 - ${log.pattern} + ${CONSOLE_LOG_PATTERN} @@ -58,7 +58,7 @@ 60 - ${log.pattern} + ${CONSOLE_LOG_PATTERN} @@ -80,7 +80,7 @@ 60 - ${log.pattern} + ${CONSOLE_LOG_PATTERN}