diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-06 15:18:00 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-06 16:37:07 +0200 |
commit | 726ba08018dad3254e8fcdbaa8fd5fa58e4bb30e (patch) | |
tree | 40d61f66cda7e6a8de2a81afb4dcc446cfc95e6f /vespa-maven-plugin | |
parent | d8b4c679ba3de823038d539a6c7226cb192bc92e (diff) |
Allow key/cert identity for submit plugin
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r-- | vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java index f3360d975c6..b0bb22fad99 100644 --- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java +++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java @@ -50,6 +50,9 @@ public class SubmitMojo extends AbstractMojo { @Parameter(property = "privateKeyFile", required = true) private String privateKeyFile; + @Parameter(property = "certificateFile") + private String certificateFile; + @Parameter(property = "authorEmail", required = true) private String authorEmail; @@ -66,9 +69,9 @@ public class SubmitMojo extends AbstractMojo { public void execute() { setup(); ApplicationId id = ApplicationId.from(tenant, application, instance); - ControllerHttpClient controller = ControllerHttpClient.withSignatureKey(URI.create(endpointUri), - Paths.get(privateKeyFile), - id); + ControllerHttpClient controller = certificateFile == null + ? ControllerHttpClient.withSignatureKey(URI.create(endpointUri), Paths.get(privateKeyFile), id) + : ControllerHttpClient.withAthenzIdentity(URI.create(endpointUri), Paths.get(privateKeyFile), Paths.get(certificateFile)); Submission submission = new Submission(repository, branch, commit, authorEmail, Paths.get(applicationZip), Paths.get(applicationTestZip)); |