Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad9c15b326 | ||
|
|
4776f49fde | ||
| 0d416e4402 | |||
| e3498099f4 | |||
| b3d9b6f767 | |||
| e308491917 | |||
|
|
9ce9cc5004 | ||
|
|
47658b560b | ||
| 439be2965d | |||
| 5a051a982d | |||
| a091bcd3c0 | |||
| b005984904 | |||
| 61b9b5aed4 | |||
| 7400641843 | |||
| 48e359d376 | |||
| 62ded20287 | |||
| 5d9f04d8d0 | |||
| 6783e1e329 | |||
| b467390c41 | |||
| eef1e3a074 | |||
| 3ed391ad78 | |||
| bd46362347 | |||
| f8467693f3 | |||
| 1d8be42e48 | |||
| 6ccddbd658 |
12
.github/workflows/release.yml
vendored
Normal file
12
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses: swordsteel/hlaeja-common-workflows/.github/workflows/release.yml@master
|
||||
secrets:
|
||||
CI_BOT_PAT: ${{ secrets.CI_BOT_PAT }}
|
||||
with:
|
||||
TYPE: catalog
|
||||
12
.github/workflows/run-checks.yml
vendored
Normal file
12
.github/workflows/run-checks.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
name: Pull request validation
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '.github/**'
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
uses: swordsteel/hlaeja-common-workflows/.github/workflows/run-checks.yml@master
|
||||
secrets:
|
||||
CI_BOT_PAT: ${{ secrets.CI_BOT_PAT }}
|
||||
@@ -4,7 +4,7 @@ A Version Catalog in Gradle is a centralized way to manage and reference depende
|
||||
|
||||
## Releasing version catalog.
|
||||
|
||||
Run `release.sh` script from `master` branch.
|
||||
Run release pipeline from `master` branch.
|
||||
|
||||
## Publishing version catalog.
|
||||
|
||||
|
||||
@@ -41,10 +41,24 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("clean") {
|
||||
tasks{
|
||||
named("publishToMavenLocal") {
|
||||
dependsOn("buildInfo")
|
||||
}
|
||||
register("clean") {
|
||||
group = "build"
|
||||
doLast {
|
||||
delete("${rootDir.path}/build")
|
||||
println("Default Cleaning!")
|
||||
}
|
||||
}
|
||||
register("buildInfo") {
|
||||
group = "hlaeja"
|
||||
description = "Prints the project name and version"
|
||||
val projectName = project.name
|
||||
val projectVersion = project.version
|
||||
doLast {
|
||||
println("Project Name: $projectName Version: $projectVersion")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
version=0.8.0
|
||||
version=0.13.0-SNAPSHOT
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
||||
#Thu Oct 17 08:20:06 BST 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
47
gradlew
vendored
47
gradlew
vendored
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -80,13 +82,11 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -133,22 +133,29 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -193,18 +200,28 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
||||
37
gradlew.bat
vendored
37
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -26,6 +28,7 @@ if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -56,32 +59,34 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
@@ -1,34 +1,39 @@
|
||||
[versions]
|
||||
# kotlin version
|
||||
kotlin = "2.0.10"
|
||||
# kotlin version (detekt limit version)
|
||||
kotlin = "2.0.21"
|
||||
|
||||
# plugin third party version
|
||||
arturboschDetektPlugin = "1.23.7"
|
||||
jlleitschuhKtlintPlugin = "12.1.1"
|
||||
springframeworkBoot = "3.3.5"
|
||||
arturboschDetektPlugin = "1.23.8"
|
||||
bmuschkoDocker = "9.4.0"
|
||||
dependencyManagementPlugin = "1.1.7"
|
||||
jlleitschuhKtlintPlugin = "12.3.0"
|
||||
jsonwebtoken = "0.12.6"
|
||||
springframeworkBoot = "3.5.4"
|
||||
|
||||
# hlaeja version
|
||||
hlaejaCorePlugin = "0.2.0"
|
||||
hlaejaCommonPlugin = "0.2.0"
|
||||
hlaejaCommonMessages = "0.6.0"
|
||||
hlaejaJwt = "0.1.0"
|
||||
hlaejaCorePlugin = "0.4.0"
|
||||
hlaejaCommonPlugin = "0.4.0"
|
||||
hlaejaCommonMessages = "0.10.0"
|
||||
hlaejaJwt = "0.2.0"
|
||||
hlaejaTest = "0.4.0"
|
||||
|
||||
|
||||
[libraries]
|
||||
influxdb-client-kotlin = { group = "com.influxdb", name = "influxdb-client-kotlin", version = "7.2.0" }
|
||||
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging-jvm", version = "7.0.3" }
|
||||
micrometer-registry-influx = { group = "io.micrometer", name = "micrometer-registry-influx", version = "1.14.2" }
|
||||
|
||||
fasterxml-jackson-module-kotlin = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin" }
|
||||
jjwt-api = { group = "io.jsonwebtoken", name = "jjwt-api", version.ref = "jsonwebtoken" }
|
||||
jjwt-impl = { group = "io.jsonwebtoken", name = "jjwt-impl", version.ref = "jsonwebtoken" }
|
||||
jjwt-jackson = { group = "io.jsonwebtoken", name = "jjwt-jackson", version.ref = "jsonwebtoken"}
|
||||
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging-jvm", version = "7.0.7" }
|
||||
fasterxml-uuid-generator = { group = "com.fasterxml.uuid", name = "java-uuid-generator", version = "5.1.0" }
|
||||
|
||||
fasterxml-jackson-module-kotlin = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin" }
|
||||
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect" }
|
||||
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-reactor" }
|
||||
postgresql = { group = "org.postgresql", name = "postgresql" }
|
||||
postgresql-r2dbc = { group = "org.postgresql", name = "r2dbc-postgresql" }
|
||||
projectreactor-kotlin-reactor-extensions = { group = "io.projectreactor.kotlin", name = "reactor-kotlin-extensions" }
|
||||
springboot-kafka = { group = "org.springframework.kafka", name = "spring-kafka" }
|
||||
springboot-redis-session = { group = "org.springframework.session", name = "spring-session-data-redis" }
|
||||
springboot-starter = { group = "org.springframework.boot", name = "spring-boot-starter" }
|
||||
springboot-starter-actuator = { group = "org.springframework.boot", name = "spring-boot-starter-actuator" }
|
||||
springboot-starter-cache = { group = "org.springframework.boot", name = "spring-boot-starter-cache" }
|
||||
@@ -37,22 +42,28 @@ springboot-starter-cassandra-reactive = { group = "org.springframework.boot", na
|
||||
springboot-starter-r2dbc = { group = "org.springframework.boot", name = "spring-boot-starter-data-r2dbc" }
|
||||
springboot-starter-redis = { group = "org.springframework.boot", name = "spring-boot-starter-data-redis" }
|
||||
springboot-starter-security = { group = "org.springframework.boot", name = "spring-boot-starter-security" }
|
||||
springboot-starter-thymeleaf = { group = "org.springframework.boot", name = "spring-boot-starter-thymeleaf" }
|
||||
springboot-starter-validation = { group = "org.springframework.boot", name = "spring-boot-starter-validation" }
|
||||
springboot-starter-webflux = { group = "org.springframework.boot", name = "spring-boot-starter-webflux" }
|
||||
thymeleaf-spring-security = { group = "org.thymeleaf.extras", name = "thymeleaf-extras-springsecurity6" }
|
||||
|
||||
# testing libraries
|
||||
assertj-core = { group = "org.assertj", name = "assertj-core", version = "3.26.3" }
|
||||
mockk = { group = "io.mockk", name = "mockk", version = "1.13.13" }
|
||||
|
||||
assertj-core = { group = "org.assertj", name = "assertj-core", version = "3.27.3" }
|
||||
mockk = { group = "io.mockk", name = "mockk", version = "1.14.5" }
|
||||
testcontainers-junit = { group = "org.testcontainers", name = "junit-jupiter" }
|
||||
testcontainers-kafka = { group = "org.testcontainers", name = "kafka" }
|
||||
testcontainers-postgresql = { group = "org.testcontainers", name = "postgresql" }
|
||||
junit-jupiter-params = { group = "org.junit.jupiter", name = "junit-jupiter-params" }
|
||||
junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" }
|
||||
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" }
|
||||
kotlin-test-junit5 = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit5" }
|
||||
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test" }
|
||||
projectreactor-reactor-test = { group = "io.projectreactor", name = "reactor-test" }
|
||||
springboot-kafka-test = { group = "org.springframework.kafka", name = "spring-kafka-test" }
|
||||
springboot-starter-test = { group = "org.springframework.boot", name = "spring-boot-starter-test" }
|
||||
|
||||
# plugin core dependencies
|
||||
org-eclipse-jgit = { group = "org.eclipse.jgit", name = "org.eclipse.jgit", version = "7.0.0.202409031743-r" }
|
||||
org-eclipse-jgit = { group = "org.eclipse.jgit", name = "org.eclipse.jgit", version = "7.3.0.202506031305-r" }
|
||||
|
||||
# plugin common dependencies
|
||||
com-bmuschko-docker-gradle-plugin = { group = "com.bmuschko", name = "gradle-docker-plugin", version.ref = "bmuschkoDocker" }
|
||||
@@ -63,29 +74,32 @@ org-jlleitschuh-ktlint-gradle-plugin = { group = "org.jlleitschuh.gradle", name
|
||||
org-springframework-springboot-gradle-plugin = { group = "org.springframework.boot", name = "spring-boot-gradle-plugin", version.ref = "springframeworkBoot" }
|
||||
|
||||
# plugin common dependencies hlaeja
|
||||
library-hlaeja-common-messages = { group = "ltd.hlaeja.library", name = "hlaeja-common-messages", version.ref = "hlaejaCommonMessages" }
|
||||
library-hlaeja-jwt = { group = "ltd.hlaeja.library", name = "hlaeja-jwt", version.ref = "hlaejaJwt" }
|
||||
library-common-messages = { group = "ltd.hlaeja.library", name = "hlaeja-common-messages", version.ref = "hlaejaCommonMessages" }
|
||||
library-jwt = { group = "ltd.hlaeja.library", name = "hlaeja-jwt", version.ref = "hlaejaJwt" }
|
||||
library-test = { group = "ltd.hlaeja.library", name = "hlaeja-test", version.ref = "hlaejaTest" }
|
||||
|
||||
|
||||
[plugins]
|
||||
spring-dependency-management = { id = "io.spring.dependency-management", version = "1.1.6" }
|
||||
|
||||
com-bmuschko-docker = { id = "com.bmuschko.docker-spring-boot-application", version.ref = "bmuschkoDocker" }
|
||||
io-gitlab-arturbosch-detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "arturboschDetektPlugin" }
|
||||
gradle-detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "arturboschDetektPlugin" }
|
||||
gradle-docker = { id = "com.bmuschko.docker-spring-boot-application", version.ref = "bmuschkoDocker" }
|
||||
gradle-ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "jlleitschuhKtlintPlugin" }
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
|
||||
org-jlleitschuh-gradle-ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "jlleitschuhKtlintPlugin" }
|
||||
springframework-boot = { id = "org.springframework.boot", version.ref = "springframeworkBoot" }
|
||||
spring-boot = { id = "org.springframework.boot", version.ref = "springframeworkBoot" }
|
||||
spring-dependency-management = { id = "io.spring.dependency-management", version.ref = "dependencyManagementPlugin" }
|
||||
|
||||
# hlaeja plugin
|
||||
ltd-hlaeja-plugin-core = { id = "ltd.hlaeja.plugin.hlaeja-core-plugin", version.ref = "hlaejaCorePlugin" }
|
||||
ltd-hlaeja-plugin-common = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.common", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-common-detekt = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.common-detekt", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-common-ktlint = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.common-ktlint", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-library = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.library", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-library-manifest = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-library-publish = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.library-publish", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-service = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-service-container = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service-container", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-service-integration-test = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service-integration-test", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-service-process-resource = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service-process-resource", version.ref = "hlaejaCommonPlugin" }
|
||||
ltd-hlaeja-plugin-certificate = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.certificate", version.ref = "hlaejaCommonPlugin" }
|
||||
core = { id = "ltd.hlaeja.plugin.hlaeja-core-plugin", version.ref = "hlaejaCorePlugin" }
|
||||
common = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.common", version.ref = "hlaejaCommonPlugin" }
|
||||
common-detekt = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.common-detekt", version.ref = "hlaejaCommonPlugin" }
|
||||
common-ktlint = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.common-ktlint", version.ref = "hlaejaCommonPlugin" }
|
||||
library = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.library", version.ref = "hlaejaCommonPlugin" }
|
||||
library-manifest = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.library-manifest", version.ref = "hlaejaCommonPlugin" }
|
||||
library-publish = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.library-publish", version.ref = "hlaejaCommonPlugin" }
|
||||
service = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service", version.ref = "hlaejaCommonPlugin" }
|
||||
service-container = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service-container", version.ref = "hlaejaCommonPlugin" }
|
||||
service-integration-test = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service-integration-test", version.ref = "hlaejaCommonPlugin" }
|
||||
service-process-resource = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.service-process-resource", version.ref = "hlaejaCommonPlugin" }
|
||||
certificate = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.certificate", version.ref = "hlaejaCommonPlugin" }
|
||||
ui-service = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.ui-service", version.ref = "hlaejaCommonPlugin" }
|
||||
ui-service-thymeleaf-minify = { id = "ltd.hlaeja.plugin.hlaeja-common-plugin.ui-service-thymeleaf-minify", version.ref = "hlaejaCommonPlugin" }
|
||||
|
||||
98
release.sh
98
release.sh
@@ -1,98 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
### This should be a pipeline, but for this example let use this ###
|
||||
|
||||
check_active_branch() {
|
||||
if [ "$(git rev-parse --abbrev-ref HEAD)" != "$1" ]; then
|
||||
echo "Error: The current branch is not $1."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_uncommitted_changes() {
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Error: There are uncommitted changes in the repository."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
prepare_environment() {
|
||||
git fetch origin
|
||||
}
|
||||
|
||||
check_last_commit() {
|
||||
last_commit_message=$(git log -1 --pretty=format:%s)
|
||||
if [ "$last_commit_message" = "[RELEASE] - bump version" ]; then
|
||||
echo "Warning: Nothing to release!!!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_differences() {
|
||||
if ! git diff --quiet origin/"$1" "$1"; then
|
||||
echo "Error: The branches origin/$1 and $1 have differences."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
un_snapshot_catalog() {
|
||||
sed -i "s/^\($1\s*=\s*\"[0-9.]*\)-SNAPSHOT.*$/\1\"/" hlaeja.versions.toml
|
||||
}
|
||||
|
||||
un_snapshot_version() {
|
||||
sed -i "s/\($1\s*=\s*[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/" gradle.properties
|
||||
}
|
||||
|
||||
current_version() {
|
||||
awk -F '=' '/version\s*=\s*[0-9.]*/ {gsub(/^ +| +$/,"",$2); print $2}' gradle.properties
|
||||
}
|
||||
|
||||
stage_files() {
|
||||
for file in "$@"; do
|
||||
if git diff --exit-code --quiet -- "$file"; then
|
||||
echo "No changes in $file"
|
||||
else
|
||||
git add "$file"
|
||||
echo "Changes in $file staged for commit"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
commit_change() {
|
||||
stage_files gradle.properties hlaeja.versions.toml
|
||||
git commit -m "[RELEASE] - $1"
|
||||
git push --porcelain origin master
|
||||
}
|
||||
|
||||
add_release_tag() {
|
||||
gitTag="v$(current_version)"
|
||||
git tag -a "$gitTag" -m "Release version $gitTag"
|
||||
git push --porcelain origin "$gitTag"
|
||||
}
|
||||
|
||||
snapshot_version() {
|
||||
new_version="$(current_version | awk -F '.' '{print $1 "." $2+1 ".0"}')"
|
||||
sed -i "s/\(version\s*=\s*\)[0-9.]*/\1$new_version-SNAPSHOT/" gradle.properties
|
||||
}
|
||||
|
||||
# check and prepare for release
|
||||
check_active_branch master
|
||||
check_uncommitted_changes
|
||||
prepare_environment
|
||||
check_last_commit
|
||||
check_differences master
|
||||
|
||||
# un-snapshot catalog versions for release
|
||||
un_snapshot_catalog "hlaejaCorePlugin"
|
||||
un_snapshot_catalog "hlaejaCommonPlugin"
|
||||
un_snapshot_catalog "hlaejaCommonMessages"
|
||||
un_snapshot_catalog "hlaejaJwt"
|
||||
|
||||
# un-snapshot properties for release
|
||||
un_snapshot_version version
|
||||
|
||||
# release changes and prepare for next release
|
||||
commit_change "release version: $(current_version)"
|
||||
add_release_tag
|
||||
snapshot_version
|
||||
commit_change 'bump version'
|
||||
Reference in New Issue
Block a user