Skip to content

Commit 059c6d3

Browse files
make tunnelname optional
1 parent 4889c72 commit 059c6d3

File tree

3 files changed

+104
-11
lines changed

3 files changed

+104
-11
lines changed

pnpm-lock.yaml

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/httpClient.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,23 @@ export default class httpClient {
219219
}
220220

221221
getTunnelDetails(ctx: Context, log: Logger) {
222+
const data: any = {
223+
orgId: ctx.orgId,
224+
userId: ctx.userId,
225+
userName: ctx.config.tunnel?.user,
226+
password: ctx.config.tunnel?.key
227+
};
228+
229+
if (ctx.config.tunnel?.tunnelName) {
230+
data.tunnelName = ctx.config.tunnel.tunnelName;
231+
}
232+
222233
return this.request({
223234
url: '/tunnel',
224235
method: 'POST',
225-
data: {
226-
tunnelName: ctx.config.tunnel?.tunnelName,
227-
orgId: ctx.orgId,
228-
userId: ctx.userId,
229-
userName: ctx.config.tunnel?.user,
230-
password: ctx.config.tunnel?.key
231-
}
232-
}, log)
236+
data: data
237+
}, log);
233238
}
234-
235239

236240
ping(buildId: string, log: Logger) {
237241
return this.request({

src/tasks/createBuildExec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
1212

1313
let errorCode = 0;
1414
try {
15-
if (ctx.config.tunnel) {
15+
if (ctx.config.tunnel && ctx.config.tunnel?.type === 'auto') {
1616
try {
1717
await startTunnelBinary(ctx);
1818
ctx.isStartExec = true;
@@ -44,7 +44,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
4444
task.title = 'Skipped SmartUI build creation'
4545
}
4646

47-
if (ctx.config.tunnel) {
47+
if (ctx.config.tunnel && ctx.config.tunnel?.type === 'auto') {
4848
if (ctx.build && ctx.build.id) {
4949
startPollingForTunnel(ctx, '', false, '');
5050
}

0 commit comments

Comments
 (0)