DevOps-fix
This commit is contained in:
+67
-39
@@ -11,65 +11,93 @@ runs:
|
|||||||
cat > ~/.gradle/init.gradle.kts << 'EOF'
|
cat > ~/.gradle/init.gradle.kts << 'EOF'
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
|
|
||||||
val OTP_REPO_PREFIX = "https://nexus.isb/repository/"
|
initscript {
|
||||||
val MAVEN_CENTRAL = "https://repo.maven.apache.org/maven2/"
|
repositories {
|
||||||
val GRADLE_PLUGIN_REPOSITORY = "https://plugins.gradle.org/m2/"
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
maven {
|
||||||
|
url = uri("http://192.168.76.117/repository/devspace-prod-mvn-hosted/")
|
||||||
|
isAllowInsecureProtocol = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath("ru.otpbank.plugin:Plugin:0.10.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
plugins.apply(ru.otpbank.devspace.plugin.BuildDataPublishPlugin::class.java)
|
||||||
|
afterEvaluate {
|
||||||
|
configure<ru.otpbank.devspace.plugin.extensions.ProjectDataExtension>{
|
||||||
|
this.url.set(uri("http://ui.devspace.xx/devspace-gateway/api/private/v1/generate"))
|
||||||
|
this.systemToken.set("54894981-c443-4ee0-9d2c-34b2a5f8713e")
|
||||||
|
authUrl=uri("http://192.168.76.150/realms/devspace-dev/protocol/openid-connect/token")
|
||||||
|
username="test"
|
||||||
|
password="test"
|
||||||
|
clientId="headless"
|
||||||
|
clientSecret="djCcy3s1TKxtO51a6TsvQ4D0EsR3RliE"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------- / Plugin / -----------------------
|
||||||
|
|
||||||
|
val OTP_REPO_PREFIX = "https://nexus.isb/repository/"
|
||||||
|
val MAVEN_CENTRAL = "https://repo.maven.apache.org/maven2/"
|
||||||
|
val GRADLE_PLUGIN_REPOSITORY = "https://plugins.gradle.org/m2/"
|
||||||
|
|
||||||
fun replaceRepository(repo: ArtifactRepository) {
|
fun replaceRepository(repo: ArtifactRepository) {
|
||||||
if (repo !is MavenArtifactRepository) {
|
if (repo !is MavenArtifactRepository) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val sourceUrl = repo.url
|
val sourceUrl = repo.url
|
||||||
when {
|
when {
|
||||||
repo.url == URI("${OTP_REPO_PREFIX}central-mvn-proxy/") -> repo.url = URI(MAVEN_CENTRAL)
|
repo.url == URI("${OTP_REPO_PREFIX}central-mvn-proxy/") -> repo.url = URI(MAVEN_CENTRAL)
|
||||||
repo.url == URI("${OTP_REPO_PREFIX}pluginsgradle-mvn-proxy/") ->
|
repo.url == URI("${OTP_REPO_PREFIX}pluginsgradle-mvn-proxy/") ->
|
||||||
repo.url = URI(GRADLE_PLUGIN_REPOSITORY)
|
repo.url = URI(GRADLE_PLUGIN_REPOSITORY)
|
||||||
repo.url.toString().startsWith(OTP_REPO_PREFIX) -> {
|
repo.url.toString().startsWith(OTP_REPO_PREFIX) -> {
|
||||||
repo.url =
|
repo.url =URI("http://192.168.76.117/repository/${repo.url.toString().removePrefix(OTP_REPO_PREFIX)}")
|
||||||
URI(
|
repo.isAllowInsecureProtocol = true
|
||||||
"http://192.168.76.117/repository/${repo.url.toString().removePrefix(OTP_REPO_PREFIX)}"
|
}
|
||||||
)
|
|
||||||
repo.isAllowInsecureProtocol = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (sourceUrl != repo.url) {
|
if (sourceUrl != repo.url) {
|
||||||
repo.isAllowInsecureProtocol = true
|
repo.isAllowInsecureProtocol = true
|
||||||
repo.credentials.username = ""
|
repo.credentials.username = ""
|
||||||
repo.credentials.password = ""
|
repo.credentials.password = ""
|
||||||
println("$sourceUrl => ${repo.url}")
|
println("$sourceUrl => ${repo.url}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val LOCAL_REPOSITORY = "file:/home/${System.getProperty("user.name")}/.m2/repository/"
|
val LOCAL_REPOSITORY = "file:/home/${System.getProperty("user.name")}/.m2/repository/"
|
||||||
|
|
||||||
gradle.settingsEvaluated {
|
gradle.settingsEvaluated {
|
||||||
pluginManagement
|
pluginManagement
|
||||||
.repositories
|
.repositories
|
||||||
.filterIsInstance<MavenArtifactRepository>()
|
.filterIsInstance<MavenArtifactRepository>()
|
||||||
.filter {
|
.filter {
|
||||||
it.url == URI("https://nexus.isb/repository/pluginsgradle-mvn-proxy/") ||
|
it.url == URI("https://nexus.isb/repository/pluginsgradle-mvn-proxy/") ||
|
||||||
it.url == URI("http://repo.xx/otp-pluginsgradle-mvn-proxy/")
|
it.url == URI("http://repo.xx/otp-pluginsgradle-mvn-proxy/")
|
||||||
}
|
}
|
||||||
.forEach {
|
.forEach {
|
||||||
pluginManagement.repositories.remove(it)
|
pluginManagement.repositories.remove(it)
|
||||||
pluginManagement.repositories.add(0, it)
|
pluginManagement.repositories.add(0, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginManagement
|
pluginManagement
|
||||||
.repositories
|
.repositories
|
||||||
.filterIsInstance<MavenArtifactRepository>()
|
.filterIsInstance<MavenArtifactRepository>()
|
||||||
.filter { it.url == URI(LOCAL_REPOSITORY) }
|
.filter { it.url == URI(LOCAL_REPOSITORY) }
|
||||||
.forEach {
|
.forEach {
|
||||||
pluginManagement.repositories.remove(it)
|
pluginManagement.repositories.remove(it)
|
||||||
pluginManagement.repositories.add(0, it)
|
pluginManagement.repositories.add(0, it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gradle.beforeSettings {
|
gradle.beforeSettings {
|
||||||
pluginManagement.repositories.configureEach { replaceRepository(this) }
|
pluginManagement.repositories.configureEach { replaceRepository(this) }
|
||||||
dependencyResolutionManagement.repositories.configureEach { replaceRepository(this) }
|
dependencyResolutionManagement.repositories.configureEach { replaceRepository(this) }
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories.configureEach { replaceRepository(this) }
|
repositories.configureEach { replaceRepository(this) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user