perf:部署项目
This commit is contained in:
@@ -2,6 +2,16 @@ stages:
|
||||
- deploy
|
||||
- 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:
|
||||
stage: deploy
|
||||
tags:
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.service.CoreLogService;
|
||||
import com.tiesheng.core.service.CoreMessageService;
|
||||
import com.tiesheng.core.util.ProcessImportConsumer;
|
||||
import com.tiesheng.database.config.DbBackupConfig;
|
||||
import com.tiesheng.demo.pojos.PoiBean;
|
||||
import com.tiesheng.demo.pojos.TestFile;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
@@ -51,13 +52,14 @@ public class TestController {
|
||||
CoreMessageService coreMessageService;
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
@Autowired
|
||||
DbBackupConfig dbBackupConfig;
|
||||
|
||||
|
||||
@RequestMapping("/index")
|
||||
public ApiResp<String> index() {
|
||||
|
||||
TokenBean tokenBean = new TokenBean("11", "", "fdfd");
|
||||
LogFactory.get().info(tokenBean.toToken());
|
||||
dbBackupConfig.dbBackup();
|
||||
|
||||
return ApiResp.respOK("hello world");
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
/**
|
||||
* 数据库备份
|
||||
*/
|
||||
public void dbBackup() {
|
||||
String url = SpringUtil.getProperty("spring.datasource.url");
|
||||
String username = SpringUtil.getProperty("spring.datasource.username");
|
||||
@@ -45,7 +48,8 @@ public class DbBackupConfig {
|
||||
LogFactory.get().info("dbBackup: " + forStr);
|
||||
forStr = RuntimeUtil.execForStr(password);
|
||||
LogFactory.get().info("dbBackup: " + forStr);
|
||||
} catch (Exception ignored) {
|
||||
} catch (Exception e) {
|
||||
LogFactory.get().info(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user