diff --git a/README.md b/README.md index 97f434a..ba00762 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Classes and endpoints, to shape and to steer, Devices and sensors, their purpose ## Releasing Service -Run `release.sh` script from `master` branch. +Run release pipeline from `master` branch. ## Development Configuration diff --git a/build.gradle.kts b/build.gradle.kts index 6ebefcc..a15de6a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,10 @@ plugins { alias(hlaeja.plugins.kotlin.jvm) alias(hlaeja.plugins.kotlin.spring) - alias(hlaeja.plugins.plugin.certificate) - alias(hlaeja.plugins.plugin.service) + alias(hlaeja.plugins.spring.boot) alias(hlaeja.plugins.spring.dependency.management) - alias(hlaeja.plugins.springframework.boot) + alias(hlaeja.plugins.certificate) + alias(hlaeja.plugins.service) } dependencies { @@ -30,8 +30,6 @@ dependencies { group = "ltd.hlaeja" -tasks { - named("processResources") { - dependsOn("copyCertificates") - } +tasks.named("processResources") { + dependsOn("copyCertificates") } diff --git a/release.sh b/release.sh deleted file mode 100755 index aa8ef8c..0000000 --- a/release.sh +++ /dev/null @@ -1,89 +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_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 - 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 version for release -un_snapshot_version version -un_snapshot_version catalog - -# release changes and prepare for next release -commit_change "release version: $(current_version)" -add_release_tag -snapshot_version -commit_change 'bump version' diff --git a/src/main/resources/logback.xml b/src/main/resources/logback-spring.xml similarity index 100% rename from src/main/resources/logback.xml rename to src/main/resources/logback-spring.xml diff --git a/src/main/resources/logback-test.xml b/src/main/resources/logback-test.xml deleted file mode 100644 index 3d69919..0000000 --- a/src/main/resources/logback-test.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - -