You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/02/22 19:59:05 UTC

[incubator-openwhisk-cli] 01/02: Fix keystore

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git

commit 011fe3ddfd077bf2b6a665d9845a885b52cefeb5
Author: dubeejw <jw...@us.ibm.com>
AuthorDate: Wed Feb 21 01:54:39 2018 -0500

    Fix keystore
---
 settings.gradle    |  2 ++
 tests/build.gradle | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/settings.gradle b/settings.gradle
index dd36ccf..4f5a4d8 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -33,3 +33,5 @@ gradle.ext.scala = [
     version: '2.11.8',
     compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import']
 ]
+
+gradle.ext.owPath = owPath
diff --git a/tests/build.gradle b/tests/build.gradle
index ec54e0f..22a54ec 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -40,3 +40,25 @@ dependencies {
 tasks.withType(ScalaCompile) {
     scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
 }
+
+
+def keystorePath = new File(sourceSets.test.scala.outputDir, 'keystore')
+task deleteKeystore(type: Delete) {
+    delete keystorePath
+}
+
+task createKeystore(dependsOn: deleteKeystore) {
+    doLast {
+        Properties props = new Properties()
+        props.load(new FileInputStream(file(gradle.owPath + '/whisk.properties')))
+        keystorePath.parentFile.mkdirs()
+        def cmd = ['keytool', '-import', '-alias', 'Whisk', '-noprompt', '-trustcacerts', '-file', file(props['whisk.ssl.cert']), '-keystore', keystorePath, '-storepass', 'openwhisk']
+        cmd.execute().waitForProcessOutput(System.out, System.err)
+    }
+}
+
+afterEvaluate {
+    tasks.withType(Test) {
+        dependsOn createKeystore
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
csantanapr@apache.org.