Skip to content

Commit

Permalink
chore: gradle builds maven credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeplotean committed Oct 23, 2023
1 parent c19ee12 commit 0c76442
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions waltid-credentials/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions waltid-crypto/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions waltid-did/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 0c76442

Please sign in to comment.