🔖 升级版本.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:2.2.1
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:2.2.2
|
||||
privileged: true
|
||||
ports:
|
||||
- 1081:80
|
||||
@@ -32,7 +32,7 @@ services:
|
||||
- mysql
|
||||
- redis
|
||||
mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:2.2.1
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:2.2.2
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
@@ -52,7 +52,7 @@ services:
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:2.2.1
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:2.2.2
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:2.2.1
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:2.2.2
|
||||
privileged: true
|
||||
ports:
|
||||
- ${SERVICE_PORT:-1081}:80
|
||||
@@ -32,7 +32,7 @@ services:
|
||||
- mysql
|
||||
- redis
|
||||
mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:2.2.1
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:2.2.2
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
@@ -52,7 +52,7 @@ services:
|
||||
retries: 15
|
||||
start_period: 3s
|
||||
redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:2.2.1
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:2.2.2
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
@@ -68,7 +68,7 @@ services:
|
||||
retries: 15
|
||||
start_period: 3s
|
||||
adminer:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:2.2.1
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:2.2.2
|
||||
ports:
|
||||
- 8081:8080
|
||||
depends_on:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#/bin/bash
|
||||
version=2.2.1
|
||||
version=2.2.2
|
||||
docker build -t orion-visor-adminer:${version} .
|
||||
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#/bin/bash
|
||||
version=2.2.1
|
||||
version=2.2.2
|
||||
cp -r ../../sql ./sql
|
||||
docker build -t orion-visor-mysql:${version} .
|
||||
rm -rf ./sql
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#/bin/bash
|
||||
version=2.2.1
|
||||
version=2.2.2
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#/bin/bash
|
||||
version=2.2.1
|
||||
version=2.2.2
|
||||
docker build -t orion-visor-redis:${version} .
|
||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#/bin/bash
|
||||
version=2.2.1
|
||||
version=2.2.2
|
||||
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
||||
mv ../../orion-visor-ui/dist ./dist
|
||||
docker build --no-cache -t orion-visor-service:${version} .
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<properties>
|
||||
<revision>2.2.1</revision>
|
||||
<revision>2.2.2</revision>
|
||||
<spring.boot.version>2.7.17</spring.boot.version>
|
||||
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
|
||||
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface AppConst extends OrionConst {
|
||||
/**
|
||||
* 同 ${orion.version} 迭代时候需要手动更改
|
||||
*/
|
||||
String VERSION = "2.2.1";
|
||||
String VERSION = "2.2.2";
|
||||
|
||||
/**
|
||||
* 同 ${spring.application.name}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* lijiahangmax ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.dromara.visor.launch;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.io.FileReaders;
|
||||
import cn.orionsec.kit.lang.utils.io.FileWriters;
|
||||
import cn.orionsec.kit.lang.utils.io.Files1;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* 替换版本号
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/12/23 10:21
|
||||
*/
|
||||
public class ReplaceVersion {
|
||||
|
||||
private static final String TARGET_VERSION = "2.2.1";
|
||||
|
||||
private static final String REPLACE_VERSION = "2.2.2";
|
||||
|
||||
private static final String PATH = new File("").getAbsolutePath();
|
||||
|
||||
private static final String[] DOCKER_FILES = new String[]{
|
||||
"docker/push.sh",
|
||||
"docker/adminer/build.sh",
|
||||
"docker/adminer/build.sh",
|
||||
"docker/mysql/build.sh",
|
||||
"docker/redis/build.sh",
|
||||
"docker/service/build.sh",
|
||||
"docker-compose.yml",
|
||||
"docker-compose-testing.yml"
|
||||
};
|
||||
|
||||
private static final String[] POM_FILES = new String[]{
|
||||
"pom.xml",
|
||||
"orion-visor-dependencies/pom.xml"
|
||||
};
|
||||
|
||||
private static final String APP_CONST_FILE = "orion-visor-framework/orion-visor-framework-common/src/main/java/org/dromara/visor/framework/common/constant/AppConst.java";
|
||||
|
||||
private static final String PACKAGE_JSON_FILE = "orion-visor-ui/package.json";
|
||||
|
||||
private static final String[] VITE_ENV_FILES = new String[]{
|
||||
"orion-visor-ui/.env.development",
|
||||
"orion-visor-ui/.env.production"
|
||||
};
|
||||
|
||||
public static void main(String[] args) {
|
||||
replaceDockerFiles();
|
||||
replacePomFiles();
|
||||
replaceAppConst();
|
||||
replacePackageJson();
|
||||
replaceViteEnvFiles();
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换 docker 文件
|
||||
*/
|
||||
private static void replaceDockerFiles() {
|
||||
for (String file : DOCKER_FILES) {
|
||||
readAndWrite(file, s -> s.replaceAll(TARGET_VERSION, REPLACE_VERSION));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换 pom 文件
|
||||
*/
|
||||
private static void replacePomFiles() {
|
||||
for (String file : POM_FILES) {
|
||||
readAndWrite(file, s -> s.replaceAll("<revision>" + TARGET_VERSION + "</revision>", "<revision>" + REPLACE_VERSION + "</revision>"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换 AppConst 文件
|
||||
*/
|
||||
private static void replaceAppConst() {
|
||||
readAndWrite(APP_CONST_FILE, s -> s.replaceAll("String VERSION = \"" + TARGET_VERSION + "\"", "String VERSION = \"" + REPLACE_VERSION + "\""));
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换 package.json 文件
|
||||
*/
|
||||
private static void replacePackageJson() {
|
||||
readAndWrite(PACKAGE_JSON_FILE, s -> s.replaceAll("\"version\": \"" + TARGET_VERSION + "\"", "\"version\": \"" + REPLACE_VERSION + "\""));
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换 .env 文件
|
||||
*/
|
||||
private static void replaceViteEnvFiles() {
|
||||
for (String file : VITE_ENV_FILES) {
|
||||
readAndWrite(file, s -> s.replaceAll("VITE_APP_VERSION= '" + TARGET_VERSION + "'", "VITE_APP_VERSION= '" + REPLACE_VERSION + "'"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取并且写入
|
||||
*
|
||||
* @param path path
|
||||
* @param mapping mapping
|
||||
*/
|
||||
private static void readAndWrite(String path, Function<String, String> mapping) {
|
||||
String filePath = Files1.getPath(PATH, path);
|
||||
try {
|
||||
// 读取文件内容
|
||||
byte[] bytes = FileReaders.readAllBytesFast(filePath);
|
||||
// 写入文件内容
|
||||
FileWriters.writeFast(filePath, mapping.apply(new String(bytes)).getBytes(StandardCharsets.UTF_8));
|
||||
System.out.println("OK: " + path);
|
||||
} catch (Exception e) {
|
||||
System.err.println("ERR: " + path);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-visor/api'
|
||||
VITE_WS_BASE_URL= 'ws://127.0.0.1:9200/orion-visor/keep-alive'
|
||||
VITE_APP_VERSION= '2.2.1'
|
||||
VITE_APP_VERSION= '2.2.2'
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
VITE_API_BASE_URL= '/orion-visor/api'
|
||||
VITE_WS_BASE_URL= '/orion-visor/keep-alive'
|
||||
VITE_APP_VERSION= '2.2.1'
|
||||
VITE_APP_VERSION= '2.2.2'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "orion-visor-ui",
|
||||
"description": "Orion Visor UI",
|
||||
"version": "2.2.1",
|
||||
"version": "2.2.2",
|
||||
"private": true,
|
||||
"author": "Jiahang Li",
|
||||
"license": "Apache 2.0",
|
||||
|
||||
Reference in New Issue
Block a user