diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index de2f199..1bd1f7c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,29 +12,30 @@ on: - opened - edited - reopened + - synchronize jobs: build-and-junits: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.1 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v3.13.0 with: - java-version: '20' + java-version: '21' distribution: 'temurin' cache: 'gradle' - name: Execute Gradle Build - uses: gradle/gradle-build-action@v2.7.1 + uses: gradle/gradle-build-action@v2.9.0 with: gradle-version: wrapper arguments: build - name: Upload Results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 with: name: junit-results path: | diff --git a/build.gradle.kts b/build.gradle.kts index 205e74a..b7425fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,35 +3,35 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar // main val romeToolsVersion = "2.1.0" -val springBootVersion = "3.1.3" -val jacksonKotlinVersion = "2.15.2" -val jacksonCoreVersion = "2.15.2" -val snakeYamlVersion = "2.1" +val springBootVersion = "3.1.5" +val jacksonKotlinVersion = "2.16.0" +val jacksonCoreVersion = "2.16.0" +val snakeYamlVersion = "2.2" val kotlinVersion = "1.7.22" val postgresqlVersion = "42.6.0" -val slf4jVersion = "2.0.7" -val jCacheVersion = "6.2.7.Final" +val slf4jVersion = "2.0.9" +val jCacheVersion = "6.3.1.Final" val ehCacheVersion = "3.10.8" val archivesBaseName = "podcast-api" plugins { - id("org.springframework.boot") version "3.1.3" - id("io.spring.dependency-management") version "1.1.3" - id("info.solidsoft.pitest") version "1.9.11" - id("com.adarshr.test-logger") version "3.2.0" // printing for JUnits + id("org.springframework.boot") version "3.1.5" + id("io.spring.dependency-management") version "1.1.4" + id("info.solidsoft.pitest") version "1.15.0" + id("com.adarshr.test-logger") version "4.0.0" // printing for JUnits // id("org.graalvm.buildtools.native") version "0.9.18" // - native - kotlin("jvm") version "1.9.10" - kotlin("plugin.spring") version "1.9.10" + kotlin("jvm") version "1.9.20" + kotlin("plugin.spring") version "1.9.20" jacoco } group = "com.rtomyj.next" -version = "1.4.3" -java.sourceCompatibility = JavaVersion.VERSION_20 +version = "1.5.0" +java.sourceCompatibility = JavaVersion.VERSION_21 repositories { @@ -101,7 +101,7 @@ apply(from = "gradle/unitTest.gradle.kts") tasks { withType { kotlinOptions { - jvmTarget = JavaVersion.VERSION_20.toString() + jvmTarget = JavaVersion.VERSION_21.toString() } } @@ -129,7 +129,7 @@ tasks { description = "Specifies the absolute path of the JAR created by the bootJar task." doFirst { - println("$buildDir/libs/$archivesBaseName-${project.version}.jar") + println("${layout.buildDirectory.get()}/libs/$archivesBaseName-${project.version}.jar") } } @@ -139,8 +139,8 @@ tasks { dependsOn(bootJar) - from("${buildDir}/libs/${archivesBaseName}-${project.version}.jar") - into("${buildDir}/libs") + from("${layout.buildDirectory.get()}/libs/${archivesBaseName}-${project.version}.jar") + into("${layout.buildDirectory.get()}/libs") rename("${archivesBaseName}-${project.version}.jar", "${archivesBaseName}.jar") } @@ -168,5 +168,5 @@ pitest { } jacoco { - toolVersion = "0.8.10" + toolVersion = "0.8.11" } \ No newline at end of file diff --git a/docker-compose-local.yml b/docker-compose-local.yml index 12ebfc0..ffcf175 100644 --- a/docker-compose-local.yml +++ b/docker-compose-local.yml @@ -2,7 +2,7 @@ version: '3.9' services: podcast-api: - image: "eclipse-temurin:20.0.1_9-jre-alpine" + image: "eclipse-temurin:21.0.1_12-jre-alpine" ports: - "9001:8080" volumes: diff --git a/docker-compose.yml b/docker-compose.yml index fdbbf52..fc83af8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.9' services: podcast-api: - image: "eclipse-temurin:20.0.1_9-jre-alpine" + image: "eclipse-temurin:21.0.1_12-jre-alpine" ports: - "80:8080" volumes: diff --git a/docker-restage.sh b/docker-restage.sh index cd2820d..20b9550 100644 --- a/docker-restage.sh +++ b/docker-restage.sh @@ -10,5 +10,6 @@ ssh -y -i ~/.ssh/podcast-api-server.pem "${user}@${server}" << EOF cd ~/api/podcast-api docker-compose kill docker-compose rm -f + docker-compose pull docker-compose up --scale podcast-api=1 -d EOF \ No newline at end of file diff --git a/gradle/unitTest.gradle.kts b/gradle/unitTest.gradle.kts index 3ef2621..e539189 100644 --- a/gradle/unitTest.gradle.kts +++ b/gradle/unitTest.gradle.kts @@ -1,13 +1,13 @@ -val springVersion = "3.1.3" +val springVersion = "3.1.5" val mockitKotlinVersion = "1.6.0" -val h2Version = "2.2.220" +val h2Version = "2.2.224" dependencies { "testImplementation"(kotlin("test")) "testImplementation"("com.nhaarman:mockito-kotlin:$mockitKotlinVersion") // provides helper functions needed for mockito to work in Kotlin "testImplementation"("org.springframework.boot:spring-boot-starter-test:$springVersion") - "testImplementation"("org.springframework.security:spring-security-test:6.1.3") + "testImplementation"("org.springframework.security:spring-security-test:6.1.5") "testRuntimeOnly"("com.h2database:h2:$h2Version") } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac72c34..3fa8f86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ 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=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # 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 $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. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_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" \ diff --git a/src/main/kotlin/com/rtomyj/podcast/service/PodcastService.kt b/src/main/kotlin/com/rtomyj/podcast/service/PodcastService.kt index 12c87bf..2999715 100644 --- a/src/main/kotlin/com/rtomyj/podcast/service/PodcastService.kt +++ b/src/main/kotlin/com/rtomyj/podcast/service/PodcastService.kt @@ -26,7 +26,7 @@ class PodcastService @Autowired constructor( companion object { private val log = LoggerFactory.getLogger(this::class.java.name) - private const val SQLExceptionLog = "SQLException occurred while inserting new podcast info. {}" + private const val SQL_EXCEPTION_LOG = "SQLException occurred while inserting new podcast info. {}" private const val PODCAST_ID_NOT_FOUND = "Podcast ID not found in DB" private const val EPISODE_ID_NOT_FOUND = "Episode ID not found in DB" private const val SOMETHING_WENT_WRONG = "Something went wrong!" @@ -82,7 +82,7 @@ class PodcastService @Autowired constructor( try { podcastCrudRepository.save(podcast) } catch (ex: DataAccessException) { - log.error(SQLExceptionLog, ex.toString()) + log.error(SQL_EXCEPTION_LOG, ex.toString()) throw PodcastException(SOMETHING_WENT_WRONG, ErrorType.DB003) } } @@ -139,7 +139,7 @@ class PodcastService @Autowired constructor( try { podcastEpisodePagingAndSortingRepository.save(podcastEpisode) } catch (ex: DataAccessException) { - log.error(SQLExceptionLog, ex.toString()) + log.error(SQL_EXCEPTION_LOG, ex.toString()) throw PodcastException(SOMETHING_WENT_WRONG, ErrorType.DB003) } }