Compare commits
4 Commits
a759d19466
...
27b335a0af
| Author | SHA1 | Date | |
|---|---|---|---|
|
27b335a0af
|
|||
|
21ed1c40b5
|
|||
|
d0c130cb61
|
|||
|
1fbff53dbd
|
@@ -4,7 +4,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GIT__TOKEN: ${{ secrets.TOKEN }}
|
INFENDRO__TOKEN: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
|
|||||||
@@ -1,55 +1,36 @@
|
|||||||
|
import com.infendro.plugin.infendro
|
||||||
|
import com.infendro.plugin.token
|
||||||
|
|
||||||
group = "com.infendro"
|
group = "com.infendro"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven("https://git.infendro.com/api/packages/Infendro/maven")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
alias(libs.plugins.infendro)
|
||||||
alias(libs.plugins.kotlin)
|
alias(libs.plugins.kotlin)
|
||||||
id("maven-publish")
|
id("maven-publish")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
infendro()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation(libs.migration)
|
||||||
implementation(libs.ktor.server)
|
implementation(libs.ktor.server)
|
||||||
implementation(libs.exposed)
|
implementation(libs.exposed)
|
||||||
implementation(libs.migration)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("JVM") {
|
create<MavenPublication>("JVM") {
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
groupId = group as String
|
groupId = project.group as String
|
||||||
artifactId = project.name
|
artifactId = project.name
|
||||||
version = version
|
version = project.version as String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
infendro(token)
|
||||||
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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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]
|
[versions]
|
||||||
|
infendro = "1.0.0"
|
||||||
kotlin = "2.2.10"
|
kotlin = "2.2.10"
|
||||||
ktor = "3.2.3"
|
ktor = "3.2.3"
|
||||||
exposed = "0.61.0"
|
exposed = "0.61.0"
|
||||||
migration = "1.1.0"
|
migration = "1.1.1"
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
|
||||||
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||||
|
|
||||||
[libraries]
|
[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" }
|
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
|
package com.infendro.ktor.migration
|
||||||
|
|
||||||
import com.infendro.migration.Config
|
|
||||||
import com.infendro.migration.migrate
|
import com.infendro.migration.migrate
|
||||||
import io.ktor.server.application.*
|
import io.ktor.server.application.*
|
||||||
import org.jetbrains.exposed.sql.Transaction
|
import org.jetbrains.exposed.sql.Transaction
|
||||||
|
|
||||||
@Suppress("UNUSED")
|
|
||||||
val Migration = createApplicationPlugin(
|
val Migration = createApplicationPlugin(
|
||||||
name = "Migration",
|
name = "Migration",
|
||||||
createConfiguration = { MigrationConfig() },
|
createConfiguration = { MigrationConfig() },
|
||||||
@@ -14,9 +12,8 @@ val Migration = createApplicationPlugin(
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MigrationConfig {
|
class MigrationConfig {
|
||||||
internal val config = Config()
|
internal val config = com.infendro.migration.MigrationConfig()
|
||||||
|
|
||||||
@Suppress("UNUSED")
|
|
||||||
fun migration(
|
fun migration(
|
||||||
name: String,
|
name: String,
|
||||||
migrate: Transaction.() -> Unit,
|
migrate: Transaction.() -> Unit,
|
||||||
|
|||||||
Reference in New Issue
Block a user