更新构建shell
This commit is contained in:
parent
dbe2a5a8ad
commit
858d00b1bf
|
|
@ -1,13 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# 远程机器上程序发布目录 user@ip:/dir
|
||||||
|
remote_dist=$1
|
||||||
|
if [[ $remote_dist ]];then
|
||||||
|
|
||||||
if [[ $1 ]];then
|
scp -r ./ruoyi-auth/build/libs/project-ruoyi-auth-*.jar $remote_dist/auth &
|
||||||
|
scp -r ./ruoyi-gateway/build/libs/project-ruoyi-gateway-*.jar $remote_dist/gateway &
|
||||||
scp -r ./ruoyi-auth/build/libs/project-ruoyi-auth-dev-9-SNAPSHOT.jar $1/auth
|
scp -r ./ruoyi-modules/ruoyi-file/build/libs/project-ruoyi-file-*.jar $remote_dist/file &
|
||||||
scp -r ./ruoyi-gateway/build/libs/project-ruoyi-gateway-dev-9-SNAPSHOT.jar $1/gateway
|
scp -r ./ruoyi-modules/ruoyi-gen/build/libs/project-ruoyi-modules-gen-*.jar $remote_dist/gen &
|
||||||
scp -r ./ruoyi-modules/ruoyi-file/build/libs/project-ruoyi-file-dev-9-SNAPSHOT.jar $1/file
|
scp -r ./ruoyi-modules/ruoyi-job/build/libs/project-ruoyi-modules-job-*.jar $remote_dist/job &
|
||||||
scp -r ./ruoyi-modules/ruoyi-gen/build/libs/project-ruoyi-modules-gen-dev-9-SNAPSHOT.jar $1/gen
|
scp -r ./ruoyi-modules/ruoyi-system/build/libs/project-ruoyi-modules-system-*.jar $remote_dist/system &
|
||||||
scp -r ./ruoyi-modules/ruoyi-job/build/libs/project-ruoyi-modules-job-dev-9-SNAPSHOT.jar $1/job
|
scp -r ./ruoyi-visual/ruoyi-monitor/build/libs/project-ruoyi-visual-monitor-*.jar $remote_dist/monitor &
|
||||||
scp -r ./ruoyi-modules/ruoyi-system/build/libs/project-ruoyi-modules-system-dev-9-SNAPSHOT.jar $1/system
|
|
||||||
scp -r ./ruoyi-visual/ruoyi-monitor/build/libs/project-ruoyi-visual-monitor-dev-9-SNAPSHOT.jar $1/monitor
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
mvn clean package -Dmaven.test.skip=true
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
docker rm -f nginx-latest
|
docker rm -f nginx-latest
|
||||||
docker run --name=nginx-latest --restart=always -p 80:80 -v /opt/pscada-online/nginx-conf/:/etc/nginx/ -v /var/logs/nginx:/var/logs/nginx -v /opt/pscada-online/www:/opt/pscada-online/www -e TZ="Asia/Shanghai" -d nginx
|
#项目程序部署目录
|
||||||
|
project=$1
|
||||||
|
docker run --name=nginx-latest --restart=always -p 80:80 -v ${project}/nginx-conf/:/etc/nginx/ -v /var/logs/nginx:/var/logs/nginx -v ${project}/www:/opt/pscada-online/www -e TZ="Asia/Shanghai" -d nginx
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
docker rm -f redis-6.0
|
docker rm -f redis-6.0
|
||||||
docker run --name=redis-6.0 --restart=always -itd -v /opt/pscada-online/redis-conf/redis.conf:/etc/redis/redis.conf -p 6379:6379 redis
|
|
||||||
|
#项目程序部署目录
|
||||||
|
project=$1
|
||||||
|
docker run --name=redis-6.0 --restart=always -itd -v ${project}/redis-conf/redis.conf:/etc/redis/redis.conf -p 6379:6379 redis
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,5 @@ allprojects {
|
||||||
ext {
|
ext {
|
||||||
buildProduct = System.getProperty("buildProduct") ?: false
|
buildProduct = System.getProperty("buildProduct") ?: false
|
||||||
}
|
}
|
||||||
task abuildAllModule(type: Exec) {
|
|
||||||
workingDir("../")
|
|
||||||
executable "build-config/build_jar.sh"
|
|
||||||
args(project.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ ext {
|
||||||
lombokVersion = "1.18.16"
|
lombokVersion = "1.18.16"
|
||||||
junitVersion = "4.13.1"
|
junitVersion = "4.13.1"
|
||||||
logbackVersion = "1.2.3"
|
logbackVersion = "1.2.3"
|
||||||
|
repoUrl="http://192.168.8.200:8081/repository"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -28,7 +29,7 @@ repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://maven.aliyun.com/repository/public/" }
|
maven { url "https://maven.aliyun.com/repository/public/" }
|
||||||
maven { url "http://192.168.8.200:8081/repository/public/" }
|
maven { url "${repoUrl}/public/" }
|
||||||
}
|
}
|
||||||
configurations.all {
|
configurations.all {
|
||||||
resolutionStrategy.cacheChangingModulesFor 0, "seconds"
|
resolutionStrategy.cacheChangingModulesFor 0, "seconds"
|
||||||
|
|
@ -52,25 +53,25 @@ dependencies {
|
||||||
jar {
|
jar {
|
||||||
|
|
||||||
// 排除掉模块调试的资源文件, 启动类.
|
// 排除掉模块调试的资源文件, 启动类.
|
||||||
excludes = []
|
excludes = ['*.yml','logback.xml']
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes "releaseVersion": version + "-" + getGitVersion()
|
attributes "releaseVersion": version + "-" + getGitVersion()
|
||||||
attributes "vendor": "GRIDNT山东网聪信息科技有限"
|
attributes "vendor": "vendor"
|
||||||
attributes "buildTime": new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00"))
|
attributes "buildTime": new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//apply plugin: "org.sonarqube"
|
apply plugin: "org.sonarqube"
|
||||||
//sonarqube {
|
sonarqube {
|
||||||
// properties {
|
properties {
|
||||||
// property "sonar.projectKey", "${project.name}"
|
property "sonar.projectKey", "${project.name}"
|
||||||
// property "sonar.projectName", "${project.name}"
|
property "sonar.projectName", "${project.name}"
|
||||||
// property "sonar.sources", "src"
|
property "sonar.sources", "src"
|
||||||
// property "sonar.java.binaries", "build"
|
property "sonar.java.binaries", "build"
|
||||||
// property "sonar.exclusions", "**/**test**/**"
|
property "sonar.exclusions", "**/**test**/**"
|
||||||
// property "sonar.sourceEncoding", "UTF-8"
|
property "sonar.sourceEncoding", "UTF-8"
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ bootJar {
|
||||||
// attributes "Main-Class": "org.springframework.boot.loader.PropertiesLauncher"
|
// attributes "Main-Class": "org.springframework.boot.loader.PropertiesLauncher"
|
||||||
// attributes "Class-Path": configurations.compileClasspath.files.collect { "../lib/$it.name" }.join(" ")
|
// attributes "Class-Path": configurations.compileClasspath.files.collect { "../lib/$it.name" }.join(" ")
|
||||||
attributes "releaseVersion": version + "-" + getGitVersion()
|
attributes "releaseVersion": version + "-" + getGitVersion()
|
||||||
attributes "vendor": "GRIDNT山东网聪信息科技有限"
|
attributes "vendor": "vendor"
|
||||||
attributes "buildTime": new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00"))
|
attributes "buildTime": new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00"))
|
||||||
}
|
}
|
||||||
launchScript()
|
launchScript()
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## 编译每个 服务
|
## 编译每个服务
|
||||||
|
|
||||||
for gfile in $(find . -name "build.gradle")
|
for gfile in $(find . -name "build.gradle")
|
||||||
do
|
do
|
||||||
if [[ $1 = cl ]];then
|
if [[ $1 = cl ]];then
|
||||||
|
|
||||||
gradle -b $gfile clean;
|
gradle -b $gfile clean &
|
||||||
echo -e "\033[32m----------------- $gfile 模块 清理 成功 ---------------------- \033[0m"
|
echo -e "\033[32m----------------- $gfile 模块 清理 成功 ---------------------- \033[0m"
|
||||||
else
|
else
|
||||||
gradle -b $gfile clean build -x test -DbuildProduct=true -DreleaseVersion=$1
|
gradle -b $gfile clean build -x test -DbuildProduct=true -DreleaseVersion=$1
|
||||||
echo -e "\033[32m----------------- $gfile 模块编译成功 ---------------------- \033[0m"
|
echo -e "\033[32m----------------- $gfile 模块编译成功 ---------------------- \033[0m"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -19,8 +19,8 @@ publishing.publications {
|
||||||
|
|
||||||
publishing.repositories {
|
publishing.repositories {
|
||||||
maven {
|
maven {
|
||||||
def releasesRepoUrl = "http://192.168.8.200:8081/repository/releases"
|
def releasesRepoUrl = "${repoUrl}/releases"
|
||||||
def snapshotsRepoUrl = "http://192.168.8.200:8081/repository/snapshots/"
|
def snapshotsRepoUrl = "${repoUrl}/snapshots/"
|
||||||
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
|
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
|
||||||
println "${group} ${archivesBaseName} publishing version is ${version}"
|
println "${group} ${archivesBaseName} publishing version is ${version}"
|
||||||
credentials {
|
credentials {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ rm -rf temp ${shortName}-third-jar.gradle
|
||||||
echo "dependencies { ">> ${shortName}-third-jar.gradle
|
echo "dependencies { ">> ${shortName}-third-jar.gradle
|
||||||
|
|
||||||
find . -name "build.gradle" | xargs cat |grep -E "compile group|compile
|
find . -name "build.gradle" | xargs cat |grep -E "compile group|compile
|
||||||
'|implementation " | egrep -v 'gridnt' >> temp
|
'|implementation " >> temp
|
||||||
sort temp |uniq >> ${shortName}-third-jar.gradle
|
sort temp |uniq >> ${shortName}-third-jar.gradle
|
||||||
rm -rf temp
|
rm -rf temp
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## 格式化 jar 引用
|
## 格式化 jar 引用,避免出错
|
||||||
|
|
||||||
find . -name "build.gradle" | xargs sed -r -i "s/'/\"/g"
|
find . -name "build.gradle" | xargs sed -r -i "s/'/\"/g"
|
||||||
find . -name "build.gradle" | xargs sed -r -i 's/compile group: /compile /g'
|
find . -name "build.gradle" | xargs sed -r -i 's/compile group: /compile /g'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue