zhangjinli 3 years ago
commit 89f4ad4d9e

@ -0,0 +1,60 @@
kind: pipeline
type: docker
name: master
steps:
- name: restore-cache
image: meltwater/drone-cache
settings:
backend: filesystem
restore: true
cache_key: "maven"
archive_format: gzip
filesystem_cache_root: "/var/lib/cache"
mount:
- "maven"
volumes:
- name: cache
path: "/var/lib/cache"
# Do stuff..
- name: build
image: maven:3.8-openjdk-8
commands:
- mkdir /root/.m2
- cp /usr/share/maven/ref/settings-docker.xml /root/.m2/settings.xml
- sed -i 's/\\/usr\\/share\\/maven\\/ref\\/repository/\\/drone\\/src\\/maven/g' /root/.m2/settings.xml
- mvn package
- name: rebuild-cache
image: meltwater/drone-cache
settings:
backend: filesystem
rebuild: true
cache_key: "maven"
archive_format: gzip
filesystem_cache_root: "/var/lib/cache"
mount:
- "maven"
volumes:
- name: cache
path: "/var/lib/cache"
- name: docker
image: plugins/docker
settings:
dockerfile: "Dockerfile.drone"
repo: harbor.oa00.com/sws/project0512
registry: harbor.oa00.com
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- master
volumes:
- name: cache
host:
path: "/var/lib/cache"
trigger:
branch:
- master
event:
- push
- merge

@ -0,0 +1,11 @@
# 编译
FROM maven:3.8-openjdk-8
COPY . /build/
WORKDIR /build
RUN mvn package
# 运行阶段
FROM openjdk:8-jdk-alpine
# 从编译阶段的中拷贝编译结果到当前镜像中
COPY --from=0 /build/target/project0512-0.0.1-SNAPSHOT.jar /work/project0512-0.0.1-SNAPSHOT.jar
WORKDIR /work
ENTRYPOINT ["java","-jar","project0512-0.0.1-SNAPSHOT.jar","--spring.profiles.active=test"]

@ -0,0 +1,6 @@
FROM openjdk:8-jdk-alpine
# 从编译阶段的中拷贝编译结果到当前镜像中
COPY ./target/project0512-0.0.1-SNAPSHOT.jar /work/project0512-0.0.1-SNAPSHOT.jar
WORKDIR /work
ENTRYPOINT ["java","-jar","project0512-0.0.1-SNAPSHOT.jar","--spring.profiles.active=test"]

@ -125,6 +125,22 @@ public class TaskController {
return Result.success(obj); return Result.success(obj);
} }
// @Data
// static class StatusTaskParam {
// @NotNull(message = "id不能为空")
// @Min(value = 1, message = "id最小值为1")
// @Schema(title = "任务id")
// private Integer id;
// @Schema(title = "任务id")
// private Integer id;
// @Schema(title = "任务id")
// private Integer id;
// }
//
// @Operation(summary = "详情")
// @PostMapping("/detail")
// public Result detail(@Validated @RequestBody StatusTaskParam param) {
//
// }
} }

@ -44,7 +44,7 @@ public class UtilsController {
@Autowired @Autowired
private AliyunOss aliyunOss; private AliyunOss aliyunOss;
@Value("${img_upload_path}") @Value("${web.uploadPath}")
private String path; private String path;
@Operation(summary="上传") @Operation(summary="上传")
@ -58,14 +58,15 @@ public class UtilsController {
// fileName=name;//图片名 // fileName=name;//图片名
// String suffixName = fileName.substring(fileName.lastIndexOf("."));//后缀名 // String suffixName = fileName.substring(fileName.lastIndexOf("."));//后缀名
//String path = System.getProperty("user.home"); //文件存储位置 我放在了我的项目下 //String path = System.getProperty("user.home"); //文件存储位置 我放在了我的项目下
//获取jar包所在目录 // //获取jar包所在目录
ApplicationHome h = new ApplicationHome(getClass()); // ApplicationHome h = new ApplicationHome(getClass());
File jarF = h.getSource(); // File jarF = h.getSource();
//在jar包所在目录下生成一个upload文件夹用来存储上传的图片 // //在jar包所在目录下生成一个upload文件夹用来存储上传的图片
String dirPath = jarF.getParentFile().toString()+"/upload/"; // String dirPath = jarF.getParentFile().toString()+"/upload/";
System.out.println(dirPath); // System.out.println(dirPath);
File dest = new File(dirPath+fileName); // System.out.println(path);
// File dest = new File(path+"/"+fileName); // File dest = new File(dirPath+fileName);
File dest = new File(path+"/"+fileName);
if (!dest.getParentFile().exists()) { if (!dest.getParentFile().exists()) {
dest.getParentFile().mkdirs(); dest.getParentFile().mkdirs();
} }

@ -1,58 +1,58 @@
server: server:
port: 8081 port: 8080
spring: spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://121.41.171.43:3306/project0512?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true url: jdbc:mysql://mysql:3306/project0512?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: project0512 username: project0512
password: zhang123. password: zhang123.
hikari: hikari:
max-lifetime: 500000 max-lifetime: 500000
redis: redis:
host: 121.41.171.43 host: redis
port: 6379 port: 6379
password: zhang123. password:
database: 15 # 指定redis的分库共16个0到15 database: 15 # 指定redis的分库共16个0到15
timeout: 5000 timeout: 5000
jackson: jackson:
date-format: yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8 time-zone: GMT+8
serialization: serialization:
write-dates-as-timestamps: false write-dates-as-timestamps: false
resources: resources:
static-locations: classpath:templates/,classpath:static/ static-locations: classpath:templates/,classpath:static/
mvc: mvc:
view: view:
prefix: / prefix: /
suffix: .html suffix: .html
servlet: servlet:
multipart: multipart:
max-file-size: 10MB max-file-size: 10MB
max-request-size: 100MB max-request-size: 100MB
pagehelper: pagehelper:
reasonable: false # 禁用合理化时如果pageNum<1或pageNum>pages会返回空数据 reasonable: false # 禁用合理化时如果pageNum<1或pageNum>pages会返回空数据
support-methods-arguments: true support-methods-arguments: true
params: count=countSql params: count=countSql
row-bounds-with-count: true row-bounds-with-count: true
helper-dialect: mysql helper-dialect: mysql
mybatis-plus: mybatis-plus:
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
auto-mapping-behavior: full auto-mapping-behavior: full
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath*:mapper/**/*Mapper.xml mapper-locations: classpath*:mapper/**/*Mapper.xml
global-config: global-config:
# 逻辑删除配置 # 逻辑删除配置
db-config: db-config:
# 删除前 # 删除前
logic-not-delete-value: 1 logic-not-delete-value: 1
# 删除后 # 删除后
logic-delete-value: 0 logic-delete-value: 0
web: web:
uploadPath: /www/wwwroot/project0512/upload/ uploadPath: /static/sws/upload/
#springdoc: #springdoc:
# swagger-ui: # swagger-ui:
@ -77,10 +77,10 @@ web:
#showSql #showSql
logging: logging:
level: level:
com: com:
example: example:
mapper: debug mapper: debug
# mac图片地址 # mac图片地址
#img_upload_path: /Users/apple/Pictures #img_upload_path: /Users/apple/Pictures
@ -89,25 +89,25 @@ img_upload_path: /img/upload/
# 阿里云oss配置信息 # 阿里云oss配置信息
oss: oss:
endpoint: oss-cn-shanghai.aliyuncs.com endpoint: oss-cn-shanghai.aliyuncs.com
accessKeyId: LTAI5tBTznxwb5K6DQBrp4f5 accessKeyId: LTAI5tBTznxwb5K6DQBrp4f5
accessKeySecret: HfXoc11JgTZt4YHzG1mnty4XpOzcz3 accessKeySecret: HfXoc11JgTZt4YHzG1mnty4XpOzcz3
bucketName: default-bucket-zh2 bucketName: default-bucket-zh2
wx: wx:
appid: wx8c9da118d7ff7200 appid: wx8c9da118d7ff7200
secret: a0af1bd6c400930bce8b2be54b9660c7 secret: a0af1bd6c400930bce8b2be54b9660c7
# 抖音开放平台配置信息 # 抖音开放平台配置信息
dy: dy:
clientKey: awty3wnxx90jper9 #抖音开放平台key clientKey: awty3wnxx90jper9 #抖音开放平台key
clientSecret: 88445885e689ce242a9dae43a047637e #抖音开放平台密钥 clientSecret: 88445885e689ce242a9dae43a047637e #抖音开放平台密钥
scope: data.external.user,data.external.item,fans.data,user_info,renew_refresh_token,data.external.user#需要用户开放的权限 scope: data.external.user,data.external.item,fans.data,user_info,renew_refresh_token,data.external.user#需要用户开放的权限
responseType: code #填写code就行 responseType: code #填写code就行
redirectUri: douyin.oa00.com #扫码之后的回调地址 redirectUri: douyin.oa00.com #扫码之后的回调地址
state: false state: false
ks: ks:
appid: ks678354694850100396 appid: ks678354694850100396
secret: ypJaxhE6340upTxMicajnA secret: ypJaxhE6340upTxMicajnA
redirectUrl: https://kuaishou.oa00.com redirectUrl: https://kuaishou.oa00.com

Loading…
Cancel
Save