From 3ae6cd44b96b898b91ed4c52ab40b8fd20ccdd88 Mon Sep 17 00:00:00 2001 From: mikeplotean <101570226+mikeplotean@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:09:24 +0300 Subject: [PATCH] chore: gradle builds maven credentials (#10) --- waltid-credentials/build.gradle.kts | 16 ++++++++-------- waltid-crypto/build.gradle.kts | 16 ++++++++-------- waltid-did/build.gradle.kts | 14 +++++++------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/waltid-credentials/build.gradle.kts b/waltid-credentials/build.gradle.kts index 78f863744..9c6bb5052 100644 --- a/waltid-credentials/build.gradle.kts +++ b/waltid-credentials/build.gradle.kts @@ -92,20 +92,20 @@ kotlin { val envUsername = System.getenv("MAVEN_USERNAME") val envPassword = System.getenv("MAVEN_PASSWORD") -// val usernameFile = File("secret_maven_username.txt") -// val passwordFile = File("secret_maven_password.txt") -// -// val secretMavenUsername = envUsername ?: usernameFile.let { if (it.isFile) it.readLines().first() else "" } - //println("Deploy username length: ${secretMavenUsername.length}") -// val secretMavenPassword = envPassword ?: passwordFile.let { if (it.isFile) it.readLines().first() else "" } + val usernameFile = File("$rootDir/secret_maven_username.txt") + val passwordFile = File("$rootDir/secret_maven_password.txt") + + val secretMavenUsername = envUsername ?: usernameFile.let { if (it.isFile) it.readLines().first() else "" } + println("Deploy username length: ${secretMavenUsername.length}") + val secretMavenPassword = envPassword ?: passwordFile.let { if (it.isFile) it.readLines().first() else "" } //if (secretMavenPassword.isBlank()) { // println("WARNING: Password is blank!") //} credentials { - username = envUsername - password = envPassword + username = secretMavenUsername + password = secretMavenPassword } } } diff --git a/waltid-crypto/build.gradle.kts b/waltid-crypto/build.gradle.kts index 51b6d09e2..7581dfcf5 100644 --- a/waltid-crypto/build.gradle.kts +++ b/waltid-crypto/build.gradle.kts @@ -93,20 +93,20 @@ kotlin { val envUsername = System.getenv("MAVEN_USERNAME") val envPassword = System.getenv("MAVEN_PASSWORD") -// val usernameFile = File("secret_maven_username.txt") -// val passwordFile = File("secret_maven_password.txt") -// -// val secretMavenUsername = envUsername ?: usernameFile.let { if (it.isFile) it.readLines().first() else "" } - //println("Deploy username length: ${secretMavenUsername.length}") -// val secretMavenPassword = envPassword ?: passwordFile.let { if (it.isFile) it.readLines().first() else "" } + val usernameFile = File("$rootDir/secret_maven_username.txt") + val passwordFile = File("$rootDir/secret_maven_password.txt") + + val secretMavenUsername = envUsername ?: usernameFile.let { if (it.isFile) it.readLines().first() else "" } + println("Deploy username length: ${secretMavenUsername.length}") + val secretMavenPassword = envPassword ?: passwordFile.let { if (it.isFile) it.readLines().first() else "" } //if (secretMavenPassword.isBlank()) { // println("WARNING: Password is blank!") //} credentials { - username = envUsername - password = envPassword + username = secretMavenUsername + password = secretMavenPassword } } } diff --git a/waltid-did/build.gradle.kts b/waltid-did/build.gradle.kts index 732345d8d..cf2961d2f 100644 --- a/waltid-did/build.gradle.kts +++ b/waltid-did/build.gradle.kts @@ -97,20 +97,20 @@ kotlin { val envUsername = System.getenv("MAVEN_USERNAME") val envPassword = System.getenv("MAVEN_PASSWORD") -// val usernameFile = File("secret_maven_username.txt") -// val passwordFile = File("secret_maven_password.txt") + val usernameFile = File("$rootDir/secret_maven_username.txt") + val passwordFile = File("$rootDir/secret_maven_password.txt") -// val secretMavenUsername = envUsername ?: usernameFile.let { if (it.isFile) it.readLines().first() else "" } - //println("Deploy username length: ${secretMavenUsername.length}") -// val secretMavenPassword = envPassword ?: passwordFile.let { if (it.isFile) it.readLines().first() else "" } + val secretMavenUsername = envUsername ?: usernameFile.let { if (it.isFile) it.readLines().first() else "" } + println("Deploy username length: ${secretMavenUsername.length}") + val secretMavenPassword = envPassword ?: passwordFile.let { if (it.isFile) it.readLines().first() else "" } //if (secretMavenPassword.isBlank()) { // println("WARNING: Password is blank!") //} credentials { - username = envUsername - password = envPassword + username = secretMavenUsername + password = secretMavenPassword } } }