Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Spring YDB CI with Maven
name: Spring YDB Retry CI with Maven

on:
push:
paths:
- 'spring-ydb/**'
- 'spring-ydb-retry/**'
branches:
- main
pull_request:
paths:
- 'spring-ydb/**'
- 'spring-ydb-retry/**'

env:
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always
Expand All @@ -33,19 +33,19 @@ jobs:
cache: 'maven'

- name: Download dependencies (Default)
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS dependency:resolve-plugins dependency:go-offline

- name: Download dependencies (Spring Boot 3)
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS -Pspring-boot3 dependency:resolve-plugins dependency:go-offline

- name: Download dependencies (Spring Boot 4)
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS -Pspring-boot4 dependency:resolve-plugins dependency:go-offline

build:
name: Spring YDB build & tests
name: Spring YDB Retry build & tests
runs-on: ubuntu-24.04
needs: prepare

Expand All @@ -63,14 +63,14 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Build spring-ydb
working-directory: ./spring-ydb
- name: Build spring-ydb-retry
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS package

- name: Tests with Spring Boot 3
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS -Pspring-boot3 test

- name: Tests with Spring Boot 4
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS -Pspring-boot4 test
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name: Publish Spring YDB
name: Publish Spring YDB Retry

on:
push:
tags:
- 'spring-ydb/v*.*.*'
- 'spring-ydb-retry/v*.*.*'

env:
MAVEN_ARGS: --batch-mode --no-transfer-progress -Dstyle.color=always

jobs:
validate:
name: Validate Spring YDB
name: Validate Spring YDB Retry
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v5

- name: Extract spring-ydb version
- name: Extract spring-ydb-retry version
run: |
cd spring-ydb
SPRING_YDB_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "SPRING_YDB_VERSION=$SPRING_YDB_VERSION" >> "$GITHUB_ENV"
cd spring-ydb-retry
SPRING_YDB_RETRY_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "SPRING_YDB_RETRY_VERSION=$SPRING_YDB_RETRY_VERSION" >> "$GITHUB_ENV"

- name: Fail workflow if version is snapshot
if: endsWith(env.SPRING_YDB_VERSION, 'SNAPSHOT')
if: endsWith(env.SPRING_YDB_RETRY_VERSION, 'SNAPSHOT')
uses: actions/github-script@v8
with:
script: core.setFailed('SNAPSHOT version cannot be published')

- name: Fail workflow if version is not equal to tag name
if: format('spring-ydb/v{0}', env.SPRING_YDB_VERSION) != github.ref_name
if: format('spring-ydb-retry/v{0}', env.SPRING_YDB_RETRY_VERSION) != github.ref_name
uses: actions/github-script@v8
with:
script: core.setFailed('Release name must be equal to project version')
Expand All @@ -42,15 +42,15 @@ jobs:
cache: 'maven'

- name: Download dependencies
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS -Pspring-boot-minimal dependency:go-offline

- name: Build with Maven
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS -Pspring-boot-minimal package

publish:
name: Publish Spring YDB
name: Publish Spring YDB Retry
runs-on: ubuntu-latest
needs: validate

Expand All @@ -75,7 +75,7 @@ jobs:
server-password: MAVEN_PASSWORD

- name: Publish package
working-directory: ./spring-ydb
working-directory: ./spring-ydb-retry
run: mvn $MAVEN_ARGS -Possrh-s01,spring-boot-minimal -Dgpg.passphrase=${{ secrets.MAVEN_OSSRH_GPG_PASSWORD }} clean deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_OSSRH_USERNAME }}
Expand Down
3 changes: 3 additions & 0 deletions spring-ydb-retry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.9.0 ##

- First version of the plugin
File renamed without changes.
124 changes: 118 additions & 6 deletions spring-ydb/spring-ydb-retry/pom.xml → spring-ydb-retry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,70 @@

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>tech.ydb</groupId>
<artifactId>spring-ydb</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<groupId>tech.ydb</groupId>
<artifactId>spring-ydb-retry</artifactId>
<version>0.9.0</version>
<packaging>jar</packaging>

<name>Spring YDB Retry</name>
<description>Spring retry module for YDB</description>
<url>https://github.com/ydb-platform/ydb-java-dialects</url>

<developers>
<developer>
<name>Ekaterina Isaeva</name>
<email>ikaterina0909@gmail.com</email>
<organization>YDB</organization>
<organizationUrl>https://ydb.tech/</organizationUrl>
</developer>
<developer>
<name>Kirill Kurdyukov</name>
<email>kurdyukov-kir@ydb.tech</email>
<organization>YDB</organization>
<organizationUrl>https://ydb.tech/</organizationUrl>
</developer>
</developers>

<scm>
<url>https://github.com/ydb-platform/ydb-java-dialects</url>
<connection>scm:git:https://github.com/ydb-platform/ydb-java-dialects.git</connection>
<developerConnection>scm:git:https://github.com/ydb-platform/ydb-java-dialects.git</developerConnection>
</scm>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>

<properties>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>6.2.0</spring.version>
<spring-boot.version>3.4.0</spring-boot.version>
<ydb-jdbc.version>2.3.22</ydb-jdbc.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>tech.ydb.jdbc</groupId>
<artifactId>ydb-jdbc-driver</artifactId>
<version>${ydb-jdbc.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
Expand Down Expand Up @@ -180,8 +233,26 @@
</build>

<profiles>
<profile>
<id>spring-boot-minimal</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring-boot.version>3.4.0</spring-boot.version>
</properties>
</profile>
<profile>
<id>spring-boot3</id>
<properties>
<spring-boot.version>3.5.7</spring-boot.version>
</properties>
</profile>
<profile>
<id>spring-boot4</id>
<properties>
<spring-boot.version>4.0.0</spring-boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -190,5 +261,46 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>ossrh-s01</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>ossrh-s01</publishingServerId>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
19 changes: 19 additions & 0 deletions spring-ydb-retry/slo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM maven:3.9-eclipse-temurin-21 AS build

WORKDIR /build

COPY pom.xml ./pom.xml
COPY src ./src
RUN mvn install -DskipTests -B

COPY slo/pom.xml ./slo/pom.xml
COPY slo/src ./slo/src
RUN cd slo && mvn package -DskipTests -B

FROM eclipse-temurin:21-jre

WORKDIR /app
COPY --from=build /build/slo/target/ydb-slo-workload-1.0.0-SNAPSHOT-exec.jar app.jar

EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ services:

app-with-retry:
build:
context: ../../../..
dockerfile: spring-ydb-retry/slo/Dockerfile
context: ../../..
dockerfile: slo/Dockerfile
container_name: ydb-app-with-retry
platform: linux/amd64
networks:
Expand All @@ -306,8 +306,8 @@ services:

app-no-retry:
build:
context: ../../../..
dockerfile: spring-ydb-retry/slo/Dockerfile
context: ../../..
dockerfile: slo/Dockerfile
container_name: ydb-app-no-retry
platform: linux/amd64
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ services:

app-with-retry:
build:
context: ../../../..
dockerfile: spring-ydb-retry/slo/Dockerfile
context: ../../..
dockerfile: slo/Dockerfile
container_name: ydb-app-with-retry
platform: linux/amd64
networks:
Expand All @@ -298,8 +298,8 @@ services:

app-no-retry:
build:
context: ../../../..
dockerfile: spring-ydb-retry/slo/Dockerfile
context: ../../..
dockerfile: slo/Dockerfile
container_name: ydb-app-no-retry
platform: linux/amd64
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>spring-ydb-retry</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
Expand Down
Loading