diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..bd1587e --- /dev/null +++ b/.drone.yml @@ -0,0 +1,34 @@ +--- +global-variables: + release: &release ${DRONE_BRANCH##**/} + gradle-image: &gradle-image gradle:7.1-jdk11 + +kind: pipeline +name: default +type: docker + +steps: + - name: gradle-test + image: *gradle-image + commands: + - gradle test + when: + branch: develop + + - name: publish + image: *gradle-image + environment: + ARCHIVA_USERNAME: + from_secret: archiva_username + ARCHIVA_PASSWORD: + from_secret: archiva_password + commands: + - gradle publish + when: + branch: release/** + +trigger: + branch: + - develop + - release/** + - master diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index a963f1a..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -image: gradle:$GRADLE_VERSION-jdk$JDK_VERSION - -stages: - - test - - deploy - -test: - stage: test - script: - - gradle --no-daemon test - artifacts: - when: always - reports: - junit: build/test-results/test/TEST-*.xml - -deploy-maven: - stage: deploy - needs: [ 'test' ] - only: - - master - script: - - gradle --no-daemon publish diff --git a/build.gradle.kts b/build.gradle.kts index 70a8033..d88aa09 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,17 +1,16 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile group = "dev.fyloz.colorrecipesexplorer" -version = "5.2" +version = "5.2.1" plugins { - kotlin("jvm") version "1.4.30" - id("org.jetbrains.dokka") version "1.4.20" + kotlin("jvm") version "1.5.21" + id("org.jetbrains.dokka") version "1.5.0" id("maven-publish") id("com.github.johnrengelman.shadow") version "6.1.0" } repositories { - jcenter() mavenCentral() } @@ -19,7 +18,7 @@ dependencies { implementation("org.liquibase:liquibase-core:4.3.1") // Logging - implementation("io.github.microutils:kotlin-logging:1.12.0") + implementation("io.github.microutils:kotlin-logging:1.12.5") implementation("org.slf4j:slf4j-api:1.7.30") implementation("ch.qos.logback:logback-classic:1.0.13") @@ -38,22 +37,12 @@ publishing { repositories { maven { - url = uri("https://git.fyloz.dev/api/v4/projects/40/packages/maven") - name = "Gitlab" + url = uri("https://archiva.fyloz.dev/repository/internal/") + name = "Archiva" - credentials(HttpHeaderCredentials::class.java) { - val gitlabPrivateToken: String? by project - - if (gitlabPrivateToken != null) { - name = "Private-Token" - value = gitlabPrivateToken - } else { - name = "Job-Token" - value = System.getenv("CI_JOB_TOKEN") - } - } - authentication { - create("header") + credentials { + username = System.getenv("ARCHIVA_USERNAME") + password = System.getenv("ARCHIVA_PASSWORD") } } } diff --git a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Database.kt b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Database.kt index f5ad381..b3d3f3e 100644 --- a/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Database.kt +++ b/src/main/kotlin/dev/fyloz/colorrecipesexplorer/databasemanager/Database.kt @@ -89,10 +89,10 @@ class CreDatabase( fun update() { val targetVersion = properties.targetVersion - if (version >= targetVersion) { - logger.warn("Database version is superior or equals to the target version. No changes will be made.") - return - } +// if (version >= targetVersion) { +// logger.warn("Database version is superior or equals to the target version. No changes will be made.") +// return +// } logger.info("Updating database from version $version to $targetVersion...")