From 2c064f22a2ad17dcdd26b9c5d4531bd1e8afba51 Mon Sep 17 00:00:00 2001 From: maverickstuder Date: Tue, 2 Apr 2024 17:12:46 +0200 Subject: [PATCH] RED-8702: Explore document databases to store entityLog - revert gitlab pipeline changes - updated tenant-commons version --- .gitlab-ci.yml | 19 +++- build.gradle.kts | 30 +---- .../config/_MultiTenantMongoDBFactory.java | 103 ------------------ 3 files changed, 19 insertions(+), 133 deletions(-) delete mode 100644 src/main/java/com/knecon/fforesight/mongo/database/commons/config/_MultiTenantMongoDBFactory.java diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a683836..7b17158 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,21 @@ include: - project: 'gitlab/gitlab' ref: 'main' - file: 'ci-templates/gradle_java.yml' \ No newline at end of file + file: 'ci-templates/gradle_java.yml' + + +deploy: + stage: deploy + tags: + - dind + script: + - echo "Building with gradle version ${BUILDVERSION}" + - gradle -Pversion=${BUILDVERSION} publish + - echo "BUILDVERSION=$BUILDVERSION" >> version.env + artifacts: + reports: + dotenv: version.env + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_COMMIT_BRANCH =~ /^release/ + - if: $CI_COMMIT_TAG \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 6011480..f903a2d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,39 +24,11 @@ repositories { mavenCentral() } -tasks.register("publish"){ - -} - -tasks.named("bootBuildImage") { - - environment.put("BPE_DELIM_JAVA_TOOL_OPTIONS", " ") - environment.put("BPE_APPEND_JAVA_TOOL_OPTIONS", "-Dfile.encoding=UTF-8") - - imageName.set("nexus.knecon.com:5001/ff/${project.name}:${project.version}") - if (project.hasProperty("buildbootDockerHostNetwork")) { - network.set("host") - } - docker { - if (project.hasProperty("buildbootDockerHostNetwork")) { - bindHostToBuilder.set(true) - } - verboseLogging.set(true) - - publishRegistry { - username.set(providers.gradleProperty("mavenUser").getOrNull()) - password.set(providers.gradleProperty("mavenPassword").getOrNull()) - email.set(providers.gradleProperty("mavenEmail").getOrNull()) - url.set("https://nexus.knecon.com:5001/") - } - } -} - val springBootVersion = "3.1.5" dependencies { - api("com.knecon.fforesight:tenant-commons:maverick-mongo-eval") + api("com.knecon.fforesight:tenant-commons:0.23.0") api("org.liquibase:liquibase-core:4.20.0") api("org.liquibase.ext:liquibase-mongodb:4.20.0") api("org.springframework.boot:spring-boot-starter-data-mongodb:${springBootVersion}") diff --git a/src/main/java/com/knecon/fforesight/mongo/database/commons/config/_MultiTenantMongoDBFactory.java b/src/main/java/com/knecon/fforesight/mongo/database/commons/config/_MultiTenantMongoDBFactory.java deleted file mode 100644 index c8e7c53..0000000 --- a/src/main/java/com/knecon/fforesight/mongo/database/commons/config/_MultiTenantMongoDBFactory.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.knecon.fforesight.mongo.database.commons.config; - -import java.util.Optional; - -import org.bson.codecs.Codec; -import org.bson.codecs.configuration.CodecRegistry; -import org.springframework.context.annotation.Configuration; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.support.PersistenceExceptionTranslator; -import org.springframework.data.mongodb.MongoDatabaseFactory; - -import com.knecon.fforesight.mongo.database.commons.service.MongoDataSources; -import com.mongodb.ClientSessionOptions; -import com.mongodb.client.ClientSession; -import com.mongodb.client.MongoDatabase; - -//@Configuration -public class _MultiTenantMongoDBFactory implements MongoDatabaseFactory { - - private final MongoDataSources mongoDataSources; - - - public _MultiTenantMongoDBFactory(MongoDataSources mongoDataSources) { - - - this.mongoDataSources = mongoDataSources; - } - - - @Override - public MongoDatabase getMongoDatabase() throws DataAccessException { - - return mongoDataSources.mongoDatabaseCurrentTenantResolver(); - } - - - @Override - public MongoDatabase getMongoDatabase(String dbName) throws DataAccessException { - - return mongoDataSources.mongoDatabaseCurrentTenantResolver(); - } - - - @Override - public PersistenceExceptionTranslator getExceptionTranslator() { - - return null; - } - - - @Override - public CodecRegistry getCodecRegistry() { - - return MongoDatabaseFactory.super.getCodecRegistry(); - } - - - @Override - public boolean hasCodecFor(Class type) { - - return MongoDatabaseFactory.super.hasCodecFor(type); - } - - - @Override - public Optional> getCodecFor(Class type) { - - return MongoDatabaseFactory.super.getCodecFor(type); - } - - - @Override - public ClientSession getSession(ClientSessionOptions options) { - - return null; - } - - - @Override - public MongoDatabaseFactory withSession(ClientSessionOptions options) { - - return MongoDatabaseFactory.super.withSession(options); - } - - - @Override - public MongoDatabaseFactory withSession(ClientSession session) { - - return null; - } - - - @Override - public boolean isTransactionActive() { - - return MongoDatabaseFactory.super.isTransactionActive(); - } - -} - - - -