perf:部署项目

This commit is contained in:
曾文豪
2023-05-11 16:12:27 +08:00
parent 0cb1581176
commit 0b98d0abb4
3 changed files with 20 additions and 4 deletions

View File

@@ -2,6 +2,16 @@ stages:
- deploy - deploy
- package - package
build-jar:
stage: deploy
tags:
- hzkepai
rules:
- if: $CI_COMMIT_BRANCH == "master"
script:
- mvn clean package -Dmaven.test.skip=true
- cp target/*.jar /usr/local/nginx/html/demo.tmp.kepai365.ltd/
deploy-jar: deploy-jar:
stage: deploy stage: deploy
tags: tags:

View File

@@ -13,6 +13,7 @@ import com.tiesheng.annotation.token.TokenIgnore;
import com.tiesheng.core.service.CoreLogService; import com.tiesheng.core.service.CoreLogService;
import com.tiesheng.core.service.CoreMessageService; import com.tiesheng.core.service.CoreMessageService;
import com.tiesheng.core.util.ProcessImportConsumer; import com.tiesheng.core.util.ProcessImportConsumer;
import com.tiesheng.database.config.DbBackupConfig;
import com.tiesheng.demo.pojos.PoiBean; import com.tiesheng.demo.pojos.PoiBean;
import com.tiesheng.demo.pojos.TestFile; import com.tiesheng.demo.pojos.TestFile;
import com.tiesheng.login.config.token.TsTokenConfig; import com.tiesheng.login.config.token.TsTokenConfig;
@@ -51,13 +52,14 @@ public class TestController {
CoreMessageService coreMessageService; CoreMessageService coreMessageService;
@Autowired @Autowired
CoreLogService coreLogService; CoreLogService coreLogService;
@Autowired
DbBackupConfig dbBackupConfig;
@RequestMapping("/index") @RequestMapping("/index")
public ApiResp<String> index() { public ApiResp<String> index() {
TokenBean tokenBean = new TokenBean("11", "", "fdfd"); dbBackupConfig.dbBackup();
LogFactory.get().info(tokenBean.toToken());
return ApiResp.respOK("hello world"); return ApiResp.respOK("hello world");
} }

View File

@@ -22,7 +22,7 @@ public class DbBackupConfig {
/** /**
* 数据库备份的路径 * 数据库备份的路径
*/ */
private String path = "/root/backup/"; private String path = "/Users/hao/Downloads/backup/";
/** /**
* 备份文件的时间格式 * 备份文件的时间格式
@@ -30,6 +30,9 @@ public class DbBackupConfig {
private String format = "yyyyMMdd"; private String format = "yyyyMMdd";
/**
* 数据库备份
*/
public void dbBackup() { public void dbBackup() {
String url = SpringUtil.getProperty("spring.datasource.url"); String url = SpringUtil.getProperty("spring.datasource.url");
String username = SpringUtil.getProperty("spring.datasource.username"); String username = SpringUtil.getProperty("spring.datasource.username");
@@ -45,7 +48,8 @@ public class DbBackupConfig {
LogFactory.get().info("dbBackup: " + forStr); LogFactory.get().info("dbBackup: " + forStr);
forStr = RuntimeUtil.execForStr(password); forStr = RuntimeUtil.execForStr(password);
LogFactory.get().info("dbBackup: " + forStr); LogFactory.get().info("dbBackup: " + forStr);
} catch (Exception ignored) { } catch (Exception e) {
LogFactory.get().info(e);
} }
} }