Skip to content

Commit 3a5206d

Browse files
author
danf
committed
Support Publish with signing
1 parent 9dfcdc8 commit 3a5206d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

api/src/main/java/com/jfrog/bintray/client/api/handle/VersionHandle.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ VersionHandle uploadDebian(String path, List<String> distributions, List<String>
6060

6161
VersionHandle publish() throws BintrayCallException;
6262

63+
VersionHandle publish(String gpgPassphrase) throws BintrayCallException;
64+
6365
VersionHandle publishSync() throws BintrayCallException;
6466

6567
VersionHandle discard() throws BintrayCallException;

impl/src/main/java/com/jfrog/bintray/client/impl/handle/VersionHandleImpl.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,17 @@ public VersionHandle uploadDebian(String path, List<String> distributions, List<
218218

219219
@Override
220220
public VersionHandle publish() throws BintrayCallException {
221-
bintrayHandle.post(getCurrentVersionContentUri() + API_PUBLISH, null);
221+
return publish(null);
222+
}
223+
224+
@Override
225+
public VersionHandle publish(String gpgPassphrase) throws BintrayCallException {
226+
Map<String, String> headers = null;
227+
if (StringUtils.isNotBlank(gpgPassphrase)) {
228+
headers = new HashMap<>();
229+
headers.put(GPG_SIGN_HEADER, gpgPassphrase);
230+
}
231+
bintrayHandle.post(getCurrentVersionContentUri() + API_PUBLISH, headers);
222232
return this;
223233
}
224234

0 commit comments

Comments
 (0)