deploy script test

This commit is contained in:
GasparAM 2023-04-09 18:50:20 +04:00
parent c35c25f1c1
commit 701c7299d4
2 changed files with 35 additions and 0 deletions

View file

@ -3,6 +3,7 @@ plugins {
id 'org.springframework.boot' version '3.0.4'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.graalvm.buildtools.native' version '0.9.20'
id 'pl.allegro.tech.build.axion-release' version '1.15.0'
}
apply plugin: 'java'
@ -37,6 +38,34 @@ dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
scmVersion {
tag {
prefix.set(rootProject.name)
}
}
project.version = scmVersion.version
tasks.named('test') {
useJUnitPlatform()
}
tasks.register('openWithBrowser') {
dependsOn 'build'
group 'Custom'
doLast {
// Option 1
String pd = "file://" + projectDir + "/build/reports/tests/test/index.html"
java.awt.Desktop desktop = java.awt.Desktop.desktop
desktop.browse(pd.toURI())
// Option 2
// String absPath = "" + projectDir + "/build/reports/tests/test/index.html"
// File file = new File(absPath)
// java.awt.Desktop.getDesktop().open(file)
}
}
// openWithBrowser.dependsOn('build')

6
deploy.sh Executable file
View file

@ -0,0 +1,6 @@
PVER = $(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout | awk 'BEGIN {FS="-"} ; {print $2}')
DVER = echo ${PVER} | awk 'BEGIN {FS="."}; {print $1"."$2"."$3 + 1}'
./mvnw -B release:prepare -Dtag=$PVER -DreleaseVersion=$PVER -DdevelopmentVersion=$DVER &&
./mvnw release:perform -Darguments="-Dmaven.deploy.skip=true"