Compare commits
4 Commits
a759d19466
...
27b335a0af
| Author | SHA1 | Date | |
|---|---|---|---|
|
27b335a0af
|
|||
|
21ed1c40b5
|
|||
|
d0c130cb61
|
|||
|
1fbff53dbd
|
@@ -4,7 +4,7 @@ on:
|
||||
- main
|
||||
|
||||
env:
|
||||
GIT__TOKEN: ${{ secrets.TOKEN }}
|
||||
INFENDRO__TOKEN: ${{ secrets.TOKEN }}
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
@@ -1,55 +1,36 @@
|
||||
import com.infendro.plugin.infendro
|
||||
import com.infendro.plugin.token
|
||||
|
||||
group = "com.infendro"
|
||||
version = "1.1.0"
|
||||
|
||||
repositories {
|
||||
maven("https://git.infendro.com/api/packages/Infendro/maven")
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.infendro)
|
||||
alias(libs.plugins.kotlin)
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
repositories {
|
||||
infendro()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.migration)
|
||||
implementation(libs.ktor.server)
|
||||
implementation(libs.exposed)
|
||||
implementation(libs.migration)
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("JVM") {
|
||||
from(components["java"])
|
||||
groupId = group as String
|
||||
groupId = project.group as String
|
||||
artifactId = project.name
|
||||
version = version
|
||||
version = project.version as String
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://git.infendro.com/api/packages/Infendro/maven")
|
||||
authentication.create("header", HttpHeaderAuthentication::class)
|
||||
credentials(HttpHeaderCredentials::class) {
|
||||
val token = secret("git.token") ?: throw GradleException()
|
||||
|
||||
name = "Authorization"
|
||||
value = "token $token"
|
||||
}
|
||||
}
|
||||
infendro(token)
|
||||
}
|
||||
}
|
||||
|
||||
fun secret(
|
||||
key: String,
|
||||
): String? {
|
||||
val property = key
|
||||
val environment = key
|
||||
.uppercase()
|
||||
.replace(".", "__")
|
||||
|
||||
val prop = properties[property] as String?
|
||||
val env = System.getenv(environment)
|
||||
|
||||
return prop ?: env
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
[versions]
|
||||
infendro = "1.0.0"
|
||||
kotlin = "2.2.10"
|
||||
ktor = "3.2.3"
|
||||
exposed = "0.61.0"
|
||||
migration = "1.1.0"
|
||||
migration = "1.1.1"
|
||||
|
||||
[plugins]
|
||||
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
|
||||
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
|
||||
[libraries]
|
||||
ktor-server = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
|
||||
|
||||
exposed = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
|
||||
migration = { module = "com.infendro:migration", version.ref = "migration" }
|
||||
ktor-server = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
|
||||
exposed = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
rootProject.name = "ktor-migration"
|
||||
rootProject.name = "migration-ktor"
|
||||
|
||||
pluginManagement.repositories {
|
||||
maven("https://git.infendro.com/api/packages/Infendro/maven")
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.infendro.ktor.migration
|
||||
|
||||
import com.infendro.migration.Config
|
||||
import com.infendro.migration.migrate
|
||||
import io.ktor.server.application.*
|
||||
import org.jetbrains.exposed.sql.Transaction
|
||||
|
||||
@Suppress("UNUSED")
|
||||
val Migration = createApplicationPlugin(
|
||||
name = "Migration",
|
||||
createConfiguration = { MigrationConfig() },
|
||||
@@ -14,9 +12,8 @@ val Migration = createApplicationPlugin(
|
||||
}
|
||||
|
||||
class MigrationConfig {
|
||||
internal val config = Config()
|
||||
internal val config = com.infendro.migration.MigrationConfig()
|
||||
|
||||
@Suppress("UNUSED")
|
||||
fun migration(
|
||||
name: String,
|
||||
migrate: Transaction.() -> Unit,
|
||||
|
||||
Reference in New Issue
Block a user