WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 2fc5c54

Browse files
committed
Jenkins: support pack signing [STUD-78152]
1 parent 6d4fc73 commit 2fc5c54

22 files changed

+472
-113
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@aoltean16 @leonard-apostoaie @AndreiDinca24
1+
* @aoltean16 @leonard-apostoaie @AndreiDinca24

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<jquery3-api.version>3.7.1-1</jquery3-api.version>
4747
<echarts-api.version>5.4.0-7</echarts-api.version>
4848
<matrix-project.version>822.824.v14451b_c0fd42</matrix-project.version>
49+
<ban-junit4-imports.skip>false</ban-junit4-imports.skip>
4950
</properties>
5051

5152
<name>UiPath Plugin</name>

src/main/java/com/uipath/uipathpackage/UiPathPack.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public class UiPathPack extends Builder implements SimpleBuildStep {
5757
private SelectEntry credentials;
5858
private final TraceLevel traceLevel;
5959
private String governanceFilePath;
60+
private String certificatePath;
61+
private String password;
62+
private String timestampServerUrl;
6063

6164
/**
6265
* Data bound constructor responsible for setting the values param values to state
@@ -87,6 +90,9 @@ public UiPathPack(SelectEntry version, String projectJsonPath, String outputPath
8790
this.credentials = null;
8891
this.runWorkflowAnalysis = false;
8992
this.governanceFilePath = null;
93+
this.certificatePath = null;
94+
this.password = null;
95+
this.timestampServerUrl = null;
9096
}
9197

9298
/**
@@ -183,6 +189,27 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnul
183189
packOptions.setProjectUrl(projectUrl);
184190
packOptions.setReleaseNotes(releaseNotes);
185191

192+
if (certificatePath != null && !certificatePath.trim().isEmpty()) {
193+
FilePath expandedSignPath = certificatePath.contains("${WORKSPACE}") ?
194+
new FilePath(launcher.getChannel(), envVars.expand(certificatePath)) :
195+
workspace.child(envVars.expand(certificatePath));
196+
packOptions.setCertificatePath(expandedSignPath.getRemote());
197+
198+
if (password != null && !password.trim().isEmpty()) {
199+
org.jenkinsci.plugins.plaincredentials.StringCredentials passwordCredentials = com.cloudbees.plugins.credentials.CredentialsMatchers.firstOrNull(
200+
com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(org.jenkinsci.plugins.plaincredentials.StringCredentials.class, run.getParent(), hudson.security.ACL.SYSTEM, java.util.Collections.emptyList()),
201+
com.cloudbees.plugins.credentials.CredentialsMatchers.withId(password)
202+
);
203+
if (passwordCredentials != null) {
204+
packOptions.setCertificatePassword(passwordCredentials.getSecret().getPlainText());
205+
}
206+
}
207+
208+
if (timestampServerUrl != null && !timestampServerUrl.trim().isEmpty()) {
209+
packOptions.setTimestampServerUrl(timestampServerUrl);
210+
}
211+
}
212+
186213
if (version instanceof ManualVersionEntry) {
187214
packOptions.setVersion(envVars.expand(((ManualVersionEntry) version).getVersion().trim()));
188215
} else if (version instanceof AutoVersionEntry) {
@@ -283,6 +310,21 @@ public void setReleaseNotes(String releaseNotes) {
283310
this.releaseNotes = releaseNotes;
284311
}
285312

313+
@DataBoundSetter
314+
public void setCertificatePath(String certificatePath) {
315+
this.certificatePath = certificatePath;
316+
}
317+
318+
@DataBoundSetter
319+
public void setPassword(String password) {
320+
this.password = password;
321+
}
322+
323+
@DataBoundSetter
324+
public void setTimestampServerUrl(String timestampServerUrl) {
325+
this.timestampServerUrl = timestampServerUrl;
326+
}
327+
286328
@DataBoundSetter
287329
public void setOrchestratorAddress(String orchestratorAddress) {
288330
this.orchestratorAddress = orchestratorAddress;
@@ -445,6 +487,18 @@ public String getReleaseNotes() {
445487
return releaseNotes;
446488
}
447489

490+
public String getCertificatePath() {
491+
return certificatePath;
492+
}
493+
494+
public String getPassword() {
495+
return password;
496+
}
497+
498+
public String getTimestampServerUrl() {
499+
return timestampServerUrl;
500+
}
501+
448502
/**
449503
* traceLevel
450504
*

src/main/java/com/uipath/uipathpackage/models/PackOptions.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class PackOptions extends CommonOptions {
1414
private String releaseNotes;
1515
private String version;
1616
private boolean autoVersion;
17+
private String certificatePath;
18+
private String certificatePassword;
19+
private String timestampServerUrl;
1720

1821
public boolean getAutoVersion() {
1922
return autoVersion;
@@ -118,4 +121,28 @@ public String getReleaseNotes() {
118121
public void setReleaseNotes(String releaseNotes) {
119122
this.releaseNotes = releaseNotes;
120123
}
124+
125+
public String getCertificatePath() {
126+
return certificatePath;
127+
}
128+
129+
public void setCertificatePath(String certificatePath) {
130+
this.certificatePath = certificatePath;
131+
}
132+
133+
public String getCertificatePassword() {
134+
return certificatePassword;
135+
}
136+
137+
public void setCertificatePassword(String certificatePassword) {
138+
this.certificatePassword = certificatePassword;
139+
}
140+
141+
public String getTimestampServerUrl() {
142+
return timestampServerUrl;
143+
}
144+
145+
public void setTimestampServerUrl(String timestampServerUrl) {
146+
this.timestampServerUrl = timestampServerUrl;
147+
}
121148
}

src/main/java/com/uipath/uipathpackage/models/solutions/SolutionPackOptions.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ public class SolutionPackOptions extends CommonOptions {
1313
private String projectUrl;
1414
private String releaseNotes;
1515
private String version;
16+
private String certificatePath;
17+
private String certificatePassword;
18+
private String timestampServerUrl;
1619

1720
public String getProjectPath() {
1821
return projectPath;
@@ -93,4 +96,28 @@ public String getReleaseNotes() {
9396
public void setReleaseNotes(String releaseNotes) {
9497
this.releaseNotes = releaseNotes;
9598
}
99+
100+
public String getCertificatePath() {
101+
return certificatePath;
102+
}
103+
104+
public void setCertificatePath(String certificatePath) {
105+
this.certificatePath = certificatePath;
106+
}
107+
108+
public String getCertificatePassword() {
109+
return certificatePassword;
110+
}
111+
112+
public void setCertificatePassword(String certificatePassword) {
113+
this.certificatePassword = certificatePassword;
114+
}
115+
116+
public String getTimestampServerUrl() {
117+
return timestampServerUrl;
118+
}
119+
120+
public void setTimestampServerUrl(String timestampServerUrl) {
121+
this.timestampServerUrl = timestampServerUrl;
122+
}
96123
}

0 commit comments

Comments
 (0)