From 853f27b845d036a25ad9c2d05d55a658c367edc4 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Fri, 5 Mar 2021 16:50:57 -0500 Subject: [PATCH] =?UTF-8?q?Le=20DSL=20pour=20cr=C3=A9er=20un=20DatabaseUpd?= =?UTF-8?q?aterProperties=20depuis=20des=20Properties=20ou=20un=20fichier?= =?UTF-8?q?=20est=20maintenant=20publique.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correction dans le fichier build.gradle.kts pour permettre le déploiement avec un CI_JOB_TOKEN. --- build.gradle.kts | 15 +++++++-------- .../databasemanager/Properties.kt | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 037a0db..f5e442c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,12 +23,6 @@ dependencies { implementation("org.slf4j:slf4j-api:1.7.30") implementation("ch.qos.logback:logback-classic:1.0.13") - // Database drivers - runtimeOnly("com.h2database:h2:1.4.199") - runtimeOnly("mysql:mysql-connector-java:8.0.22") - runtimeOnly("org.postgresql:postgresql:42.2.16") - runtimeOnly("com.microsoft.sqlserver:mssql-jdbc:9.2.1.jre11") - testImplementation("io.mockk:mockk:1.10.6") testImplementation("io.kotest:kotest-runner-junit5:4.4.1") } @@ -48,8 +42,13 @@ publishing { credentials(HttpHeaderCredentials::class.java) { val gitlabPrivateToken: String? by project - name = "Private-Token" - value = gitlabPrivateToken ?: System.getenv("CI_JOB_TOKEN") + if (gitlabPrivateToken != null) { + name = "Private-Token" + value = gitlabPrivateToken + } else { + name = "Job-Token" + value = System.getenv("CI_JOB_TOKEN") + } } authentication { create("header") diff --git a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Properties.kt b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Properties.kt index 93a1b22..ed39f17 100644 --- a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Properties.kt +++ b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Properties.kt @@ -59,7 +59,7 @@ fun databaseUpdaterProperties( ) = DatabaseUpdaterProperties(targetVersion, url, dbName, username, password).apply(op) /** DSL for creating an instance of [DatabaseUpdaterProperties] from the given [properties]. */ -internal fun databaseUpdaterProperties( +fun databaseUpdaterProperties( properties: Properties, op: DatabaseUpdaterProperties.() -> Unit = {} ) = with(properties) { @@ -80,7 +80,7 @@ internal fun databaseUpdaterProperties( } /** DSL for creating an instance of [DatabaseUpdaterProperties] from the given [file]. */ -internal fun databaseUpdaterProperties( +fun databaseUpdaterProperties( file: File, op: DatabaseUpdaterProperties.() -> Unit = {} ) = databaseUpdaterProperties(