Skip to content

Commit

Permalink
Merge pull request #233 from SonicCloudOrg/dev
Browse files Browse the repository at this point in the history
release
  • Loading branch information
ZhouYixun authored Jul 10, 2022
2 parents c02aa6d + 4ac564e commit 6a12d77
Show file tree
Hide file tree
Showing 18 changed files with 264 additions and 51 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
- name: git Actions
uses: srt32/[email protected]
- name: get agent
run: git clone https://github.com/SonicCloudOrg/sonic-agent.git && cd sonic-agent && mvn package -Plinux-x86_64 && docker build -t sonicorg/sonic-agent-linux:v1.4.1-rc -f src/main/docker/Dockerfile .
run: git clone https://github.com/SonicCloudOrg/sonic-agent.git && cd sonic-agent && mvn package -Plinux-x86_64 && docker build -t sonicorg/sonic-agent-linux:v1.4.1-release -f src/main/docker/Dockerfile .
- name: push
run: docker push sonicorg/sonic-agent-linux:v1.4.1-rc
run: docker push sonicorg/sonic-agent-linux:v1.4.1-release
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN_ALIYUN }}" | docker login --username=小虫哔哔 registry.cn-hangzhou.aliyuncs.com --password-stdin
- name: tag
run: docker tag sonicorg/sonic-agent-linux:v1.4.1-rc registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:v1.4.1-rc
run: docker tag sonicorg/sonic-agent-linux:v1.4.1-release registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:v1.4.1-release
- name: push
run: docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:v1.4.1-rc
run: docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:v1.4.1-release
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN_ALIYUN }}" | docker login --username=小虫哔哔 registry.cn-hangzhou.aliyuncs.com --password-stdin
- name: tag
run: docker tag sonicorg/sonic-server-eureka:v1.4.1-rc registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-eureka:v1.4.1-rc && docker tag sonicorg/sonic-server-controller:v1.4.1-rc registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-controller:v1.4.1-rc && docker tag sonicorg/sonic-server-folder:v1.4.1-rc registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-folder:v1.4.1-rc && docker tag sonicorg/sonic-server-gateway:v1.4.1-rc registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-gateway:v1.4.1-rc
run: docker tag sonicorg/sonic-server-eureka:v1.4.1-release registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-eureka:v1.4.1-release && docker tag sonicorg/sonic-server-controller:v1.4.1-release registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-controller:v1.4.1-release && docker tag sonicorg/sonic-server-folder:v1.4.1-release registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-folder:v1.4.1-release && docker tag sonicorg/sonic-server-gateway:v1.4.1-release registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-gateway:v1.4.1-release
- name: push
run: docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-eureka:v1.4.1-rc && docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-controller:v1.4.1-rc && docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-folder:v1.4.1-rc && docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-gateway:v1.4.1-rc
run: docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-eureka:v1.4.1-release && docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-controller:v1.4.1-release && docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-folder:v1.4.1-release && docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-gateway:v1.4.1-release
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-server-eureka:
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-eureka:v1.4.1-rc"
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-eureka:v1.4.1-release"
hostname: sonic-server-eureka
environment:
- SONIC_EUREKA_USERNAME
Expand All @@ -15,7 +15,7 @@ services:
ports:
- "${SONIC_EUREKA_PORT}:${SONIC_EUREKA_PORT}"
sonic-server-gateway:
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-gateway:v1.4.1-rc"
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-gateway:v1.4.1-release"
hostname: sonic-server-gateway
environment:
- SONIC_EUREKA_USERNAME
Expand All @@ -32,7 +32,7 @@ services:
- sonic-network
restart: on-failure
sonic-server-controller:
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-controller:v1.4.1-rc"
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-controller:v1.4.1-release"
environment:
- SONIC_EUREKA_USERNAME
- SONIC_EUREKA_PASSWORD
Expand Down Expand Up @@ -64,7 +64,7 @@ services:
- sonic-server-eureka
restart: on-failure
sonic-server-folder:
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-folder:v1.4.1-rc"
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-server-folder:v1.4.1-release"
environment:
- SONIC_EUREKA_USERNAME
- SONIC_EUREKA_PASSWORD
Expand All @@ -86,7 +86,7 @@ services:
- sonic-server-eureka
restart: on-failure
sonic-client-web:
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-client-web:v1.4.1-rc"
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-client-web:v1.4.1-release"
environment:
- SONIC_SERVER_HOST
- SONIC_SERVER_PORT
Expand Down
10 changes: 5 additions & 5 deletions docker-compose2.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-server-eureka:
image: "sonicorg/sonic-server-eureka:v1.4.1-rc"
image: "sonicorg/sonic-server-eureka:v1.4.1-release"
hostname: sonic-server-eureka
environment:
- SONIC_EUREKA_USERNAME
Expand All @@ -15,7 +15,7 @@ services:
ports:
- "${SONIC_EUREKA_PORT}:${SONIC_EUREKA_PORT}"
sonic-server-gateway:
image: "sonicorg/sonic-server-gateway:v1.4.1-rc"
image: "sonicorg/sonic-server-gateway:v1.4.1-release"
hostname: sonic-server-gateway
environment:
- SONIC_EUREKA_USERNAME
Expand All @@ -32,7 +32,7 @@ services:
- sonic-network
restart: on-failure
sonic-server-controller:
image: "sonicorg/sonic-server-controller:v1.4.1-rc"
image: "sonicorg/sonic-server-controller:v1.4.1-release"
environment:
- SONIC_EUREKA_USERNAME
- SONIC_EUREKA_PASSWORD
Expand Down Expand Up @@ -64,7 +64,7 @@ services:
- sonic-server-eureka
restart: on-failure
sonic-server-folder:
image: "sonicorg/sonic-server-folder:v1.4.1-rc"
image: "sonicorg/sonic-server-folder:v1.4.1-release"
environment:
- SONIC_EUREKA_USERNAME
- SONIC_EUREKA_PASSWORD
Expand All @@ -86,7 +86,7 @@ services:
- sonic-server-eureka
restart: on-failure
sonic-client-web:
image: "sonicorg/sonic-client-web:v1.4.1-rc"
image: "sonicorg/sonic-client-web:v1.4.1-release"
environment:
- SONIC_SERVER_HOST
- SONIC_SERVER_PORT
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
<current.version>1.4.1-rc</current.version>
<current.version>1.4.1-release</current.version>
</properties>

<!-- SpringCloud版本管理 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ filter:
spring:
cloud:
gateway:
httpclient:
websocket:
max-frame-payload-length: 314572800
routes:
- id: controller
uri: lb://sonic-server-controller
Expand Down
6 changes: 6 additions & 0 deletions sonic-server-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- eureka客户端 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public RespModel<String> update(@RequestBody JSONObject jsonObject) {
agentsService.update(jsonObject.getInteger("id"),
jsonObject.getString("name"), jsonObject.getInteger("highTemp"),
jsonObject.getInteger("highTempTime"), jsonObject.getInteger("robotType"),
jsonObject.getString("robotToken"), jsonObject.getString("robotToken"));
jsonObject.getString("robotToken"), jsonObject.getString("robotSecret"));
return new RespModel<>(RespEnum.HANDLE_OK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import java.util.List;

@Api(tags = "公共参数相关")
@Api(tags = "全局参数相关")
@RestController
@RequestMapping("/globalParams")
public class GlobalParamsController {
Expand All @@ -40,23 +40,23 @@ public class GlobalParamsController {
private GlobalParamsService globalParamsService;

@WebAspect
@ApiOperation(value = "更新公共参数", notes = "新增或更新对应的公共参数")
@ApiOperation(value = "更新全局参数", notes = "新增或更新对应的全局参数")
@PutMapping
public RespModel<String> save(@Validated @RequestBody GlobalParamsDTO globalParamsDTO) {
globalParamsService.save(globalParamsDTO.convertTo());
return new RespModel<>(RespEnum.UPDATE_OK);
}

@WebAspect
@ApiOperation(value = "查找公共参数", notes = "查找对应项目id的公共参数列表")
@ApiOperation(value = "查找全局参数", notes = "查找对应项目id的全局参数列表")
@ApiImplicitParam(name = "projectId", value = "项目id", dataTypeClass = Integer.class)
@GetMapping("/list")
public RespModel<List<GlobalParams>> findByProjectId(@RequestParam(name = "projectId") int projectId) {
return new RespModel<>(RespEnum.SEARCH_OK, globalParamsService.findAll(projectId));
}

@WebAspect
@ApiOperation(value = "删除公共参数", notes = "删除对应id的公共参数")
@ApiOperation(value = "删除全局参数", notes = "删除对应id的全局参数")
@ApiImplicitParam(name = "id", value = "id", dataTypeClass = Integer.class)
@DeleteMapping
public RespModel<String> delete(@RequestParam(name = "id") int id) {
Expand All @@ -68,7 +68,7 @@ public RespModel<String> delete(@RequestParam(name = "id") int id) {
}

@WebAspect
@ApiOperation(value = "查看公共参数信息", notes = "查看对应id的公共参数")
@ApiOperation(value = "查看全局参数信息", notes = "查看对应id的全局参数")
@ApiImplicitParam(name = "id", value = "id", dataTypeClass = Integer.class)
@GetMapping
public RespModel<GlobalParams> findById(@RequestParam(name = "id") int id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ public class RolesController {
@GetMapping("/list")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "page", value = "页码", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "isAll", value = "是否全部", dataTypeClass = Boolean.class),
@ApiImplicitParam(name = "roleName", value = "角色名称", dataTypeClass = String.class),

})
public RespModel<CommentPage<RolesDTO>> listResources(@RequestParam(name = "page") int page
, @RequestParam(name = "roleName", required = false) String roleName) {
public RespModel<CommentPage<RolesDTO>> listResources(@RequestParam(name = "page") int page,
@RequestParam(name = "isAll", required = false) boolean isAll,
@RequestParam(name = "roleName", required = false) String roleName) {
Page<Roles> pageable = new Page<>(page, 20);
if (isAll) {
pageable.setSize(1000L);
}

return RespModel.result(RespEnum.SEARCH_OK, rolesServices.listRoles(pageable, roleName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class Projects implements Serializable, TypeConverter<Projects, ProjectsD
private String projectName;

@TableField
@Column(value = "robot_secret", isNull = false, comment = "机器人秘钥")
@Column(value = "robot_secret", isNull = true, comment = "机器人秘钥")
private String robotSecret;

@TableField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ProjectsDTO implements Serializable, TypeConverter<ProjectsDTO, Pro
@ApiModelProperty(value = "机器人token", required = true, example = "http://dingTalk.com?token=*****")
String robotToken;

@ApiModelProperty(value = "机器人加签密钥", required = true, example = "qwe***")
@ApiModelProperty(value = "机器人加签密钥", required = false, example = "qwe***")
String robotSecret;

@ApiModelProperty(value = "项目图标", required = true, example = "http://img.jpg")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public String findOne(int projectId, String branch, String platform) {
Packages packages = lambdaQuery().eq(Packages::getProjectId, projectId)
.eq(StringUtils.isNotBlank(platform), Packages::getPlatform, platform)
.like(StringUtils.isNotBlank(branch), Packages::getBranch, branch)
.orderByDesc(Packages::getId).one();
.orderByDesc(Packages::getId).last("LIMIT 1").one();
if (packages != null) {
return packages.getUrl();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ private Resources processParent(String beanName, Map<String, Resources> parentMa
parentResource.setDesc(tag);
parentResource.setPath(res);
parentResource.setVersion(version);
// 每次扫描都把parent 设置为正常资源
parentResource.setWhite(UrlType.NORMAL );

if (needInsert) {
insert(parentResource);
Expand Down Expand Up @@ -202,6 +204,7 @@ public CommentPage<ResourcesDTO> listResource(Page<Resources> page, String path,

private List<ResourcesDTO> listParentResource() {
return lambdaQuery().eq(Resources::getParentId, UrlType.PARENT)
.eq(Resources::getWhite, UrlType.NORMAL)
.orderByDesc(Resources::getId)
.list().stream()
.map(TypeConverter::convertTo).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void sendDayReport() {
break;
}
}
if (projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
if (projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 ) {
robotMsgTool.sendDayReportMessage(projects.getRobotToken(), projects.getRobotSecret(), projects.getId()
, projects.getProjectName(), sf.format(yesterday), sf.format(today), suc, warn, fail, projects.getRobotType());
}
Expand Down Expand Up @@ -266,7 +266,7 @@ public void sendWeekReport() {
break;
}
}
if (projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
if (projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 ) {
robotMsgTool.sendWeekReportMessage(projects.getRobotToken(), projects.getRobotSecret(), projects.getId()
, projects.getProjectName(), sf.format(lastWeek), sf.format(today), suc, warn, fail, count, projects.getRobotType());
}
Expand Down Expand Up @@ -330,7 +330,7 @@ public void setStatus(Results results) {
results.setEndTime(new Date());
save(results);
Projects projects = projectsService.findById(results.getProjectId());
if (projects != null && projects.getRobotType() != 0 && projects.getRobotToken().length() > 0 && projects.getRobotSecret().length() > 0) {
if (projects != null && projects.getRobotType() != 0 && projects.getRobotToken().length() > 0) {
robotMsgTool.sendResultFinishReport(projects.getRobotToken(), projects.getRobotSecret(),
results.getSuiteName(), sucCount, warnCount, failCount, projects.getId(), results.getId(), projects.getRobotType());
}
Expand Down
Loading

0 comments on commit 6a12d77

Please sign in to comment.