Skip to content

Commit

Permalink
dependency update
Browse files Browse the repository at this point in the history
version update
dev release workflow added
  • Loading branch information
Oleg Smelov committed Aug 24, 2023
1 parent 9ff0547 commit 82e3db2
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 28 deletions.
76 changes: 64 additions & 12 deletions .github/workflows/dev-release-java-publish-sonatype-and-docker.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,74 @@
name: Build and release Java distributions to sonatype.
name: Build and publish Docker distributions to Github Container Registry ghcr.io

on:
push:
tags:
- \d+.\d+.\d+-dev

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
versions:
name: Extract app version
uses: th2-net/.github/.github/workflows/compound-prebuild-java-workflow.yml@main
build-and-publish-grpc-java:
name: Build and publish Java gRPC distributions
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v3
- name: Set up JDK 'zulu' '11'
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew --info -Pversion_suffix='dev' clean build publish closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}

build-and-publish-grpc-python:
name: Build and publish Python distributions to PyPI
needs:
- build-and-publish-grpc-java
- versions
uses: th2-net/.github/.github/workflows/compaund-python-grpc-pypi-publication.yml@main
with:
custom-version: ${{ needs.versions.outputs.version }}-dev
project-path: grpc
secrets:
pypi_password: ${{ secrets.PYPI_PASSWORD }}

owasp-scan:
uses: th2-net/.github/.github/workflows/owasp-gradle-scan.yml@main
with:
multiproject: true

publish-docker:
name: Build and publish docker image
needs:
- build-and-publish-grpc-python
- build-and-publish-grpc-java
- versions
uses: th2-net/.github/.github/workflows/compaund-java-docker-push.yml@main
with:
build-target: 'Sonatype,Docker'
runsOn: ubuntu-latest
gradleVersion: '7'
docker-username: ${{ github.actor }}
devRelease: true
version: ${{ needs.versions.outputs.version }}-dev
versionNumber: ${{ needs.versions.outputs.version }}
dockerContext: '.'
gradleParameters: '["clean", "build", "dockerPrepare"]'
secrets:
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
docker-password: ${{ secrets.GITHUB_TOKEN }}

trivy-docker-scan:
name: Scan Docker image for vulnerabilities
needs:
- publish-docker
- versions
uses: th2-net/.github/.github/workflows/trivy-scan-github.yml@main
with:
image-path: ghcr.io/${{ github.repository }}:${{ needs.versions.outputs.version }}-dev
target: 'os,library'
sensitivity: 'CRITICAL,HIGH,MEDIUM'
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# th2-read-db 0.1.0
# th2-read-db 0.3.0

The read-db is a component for extracting data from databases using JDBC technology. If database has JDBC driver the read can work with the database

Expand Down Expand Up @@ -177,6 +177,10 @@ spec:

## Changes

### 0.1.0
### 0.3.0

+ MSSQL support added

### 0.2.0

+ Added support for th2 transport protocol
7 changes: 5 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ dependencies {
implementation project(':read-db-core')

//region Drivers
runtimeOnly('org.postgresql:postgresql:42.5.3') {
runtimeOnly('org.postgresql:postgresql:42.6.0') {
because('prostresql support')
}
runtimeOnly('com.mysql:mysql-connector-j:8.1.0') {
because('mysql support')
}
runtimeOnly('com.oracle.database.jdbc:ojdbc11:21.9.0.0') {
runtimeOnly('com.oracle.database.jdbc:ojdbc11:23.2.0.0') {
because('oracle support')
}
runtimeOnly('com.microsoft.sqlserver:mssql-jdbc:12.4.0.jre11') {
because('mssql support')
}
//endregion
}

Expand Down
2 changes: 1 addition & 1 deletion app/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
kotlin.code.style=official
release_version=0.2.0
release_version=0.3.0
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sourceCompatibility = 11
targetCompatibility = 11

ext {
coroutines_version = '1.6.4'
coroutines_version = '1.7.3'
}

tasks.withType(KotlinCompile).configureEach {
Expand Down Expand Up @@ -48,7 +48,7 @@ dependencies {

testImplementation "org.junit.jupiter:junit-jupiter:5.10.0"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testImplementation "org.mockito.kotlin:mockito-kotlin:5.1.0"
testImplementation "io.strikt:strikt-core:0.34.1"

testImplementation platform("org.testcontainers:testcontainers-bom:1.19.0")
Expand Down
2 changes: 1 addition & 1 deletion core/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
kotlin.code.style=official
release_version=0.1.0
release_version=0.3.0
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import com.exactpro.th2.read.db.core.ResultListener
import com.exactpro.th2.read.db.core.RowListener
import com.exactpro.th2.read.db.core.TableRow
import com.exactpro.th2.read.db.core.UpdateListener
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.argumentCaptor
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.times
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.verifyZeroInteractions
import org.mockito.kotlin.any
import org.mockito.kotlin.argumentCaptor
import org.mockito.kotlin.mock
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyNoInteractions
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.test.advanceTimeBy
Expand Down Expand Up @@ -123,7 +123,7 @@ internal class DataBaseReaderIntegrationTest {

genericRowListener.assertCaptured(persons)
listener.assertCaptured(persons)
verifyZeroInteractions(genericUpdateListener)
verifyNoInteractions(genericUpdateListener)
}
}

Expand Down Expand Up @@ -179,7 +179,7 @@ internal class DataBaseReaderIntegrationTest {

genericUpdateListener.assertCaptured(newData)
listener.assertCaptured(newData)
verifyZeroInteractions(genericRowListener)
verifyNoInteractions(genericRowListener)
reader.stopPullTask(taskId)

advanceUntilIdle()
Expand Down

0 comments on commit 82e3db2

Please sign in to comment.