Add version logging to hsm signing service (#502)

Add version logging to hsm signing service
This commit is contained in:
Katarzyna Streich 2018-03-06 14:56:05 +00:00 committed by GitHub
parent d79e365a5b
commit e4d2155671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 11 deletions

View File

@ -112,10 +112,3 @@ dependencies {
compile "org.bouncycastle:bcprov-jdk15on:${bouncycastle_version}"
compile "org.bouncycastle:bcpkix-jdk15on:${bouncycastle_version}"
}
jar {
classifier "ignore"
manifest {
attributes('Network-Management-Version': version)
}
}

View File

@ -23,6 +23,11 @@ task buildHsmJAR(type: FatCapsule, dependsOn: 'jar') {
project(':network-management').configurations.runtime,
project(':network-management').jar
)
tasks.withType(Jar) { task ->
manifest {
attributes('Signing-Service-Version': version)
}
}
}
artifacts {

View File

@ -23,6 +23,11 @@ task buildDoormanJAR(type: FatCapsule, dependsOn: ':network-management:jar') {
project(':network-management').configurations.runtime,
project(':network-management').jar
)
tasks.withType(Jar) { task ->
manifest {
attributes('Doorman-Version': version)
}
}
}
artifacts {

View File

@ -42,9 +42,9 @@ class ApproveAllCertificateRequestStorage(private val delegate: CertificateSigni
}
}
private fun logNetworkManagementVersion() {
if (Manifests.exists("Network-Management-Version")) {
println("Network Management Version: ${Manifests.read("Network-Management-Version")}")
private fun logDoormanVersion() {
if (Manifests.exists("Doorman-Version")) {
println("Doorman Version: ${Manifests.read("Doorman-Version")}")
}
}
@ -52,7 +52,7 @@ fun main(args: Array<String>) {
try {
parseParameters(*args).run {
println("Starting in $mode mode")
logNetworkManagementVersion()
logDoormanVersion()
when (mode) {
Mode.ROOT_KEYGEN -> generateRootKeyPair(
rootStorePath ?: throw IllegalArgumentException("The 'rootStorePath' parameter must be specified when generating keys!"),

View File

@ -1,6 +1,7 @@
package com.r3.corda.networkmanage.hsm
import com.google.common.primitives.Booleans
import com.jcabi.manifests.Manifests
import com.r3.corda.networkmanage.common.persistence.configureDatabase
import com.r3.corda.networkmanage.common.utils.ShowHelpException
import com.r3.corda.networkmanage.common.utils.initialiseSerialization
@ -14,7 +15,14 @@ import javax.crypto.Cipher
private val logger = LogManager.getLogger("com.r3.corda.networkmanage.hsm.Main")
private fun logServiceVersion() {
if (Manifests.exists("Signing-Service-Version")) {
println("Signing Service Version: ${Manifests.read("Signing-Service-Version")}")
}
}
fun main(args: Array<String>) {
logServiceVersion()
parseParameters(*args).run {
try {
// Validate