Skip to content

Commit 9c58c2e

Browse files
authored
Merge pull request #340 from Nick-1234531/DOT-3747
build username changes
2 parents 8edad96 + 87b4c8e commit 9c58c2e

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/lib/httpClient.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ export default class httpClient {
142142
const response = await this.request({
143143
url: '/token/verify',
144144
method: 'GET',
145+
headers:{
146+
userName : env.LT_USERNAME,
147+
accessKey: env.LT_ACCESS_KEY
148+
}
145149
}, log);
146150
if (response && response.projectToken) {
147151
this.projectToken = response.projectToken;
@@ -157,8 +161,8 @@ export default class httpClient {
157161

158162
async authExec(ctx: Context, log: Logger, env: Env): Promise<{ authResult: number, orgId: number, userId: number }> {
159163
let authResult = 1;
160-
let userName = '';
161-
let passWord = '';
164+
let userName = ctx.env.LT_USERNAME;
165+
let passWord = ctx.env.LT_ACCESS_KEY;
162166
if (ctx.config.tunnel) {
163167
if (ctx.config.tunnel?.user && ctx.config.tunnel?.key) {
164168
userName = ctx.config.tunnel.user
@@ -202,10 +206,14 @@ export default class httpClient {
202206
}
203207
}
204208

205-
createBuild(git: Git, config: any, log: Logger, buildName: string, isStartExec: boolean, smartGit: boolean, markBaseline: boolean, baselineBuild: string, scheduled?: string) {
209+
createBuild(git: Git, config: any, log: Logger, buildName: string, isStartExec: boolean, smartGit: boolean, markBaseline: boolean, baselineBuild: string, scheduled?: string,userName?: string,accessKey?: string) {
206210
return this.request({
207211
url: '/build',
208212
method: 'POST',
213+
headers:{
214+
userName,
215+
accessKey
216+
},
209217
data: {
210218
git,
211219
config,

src/tasks/createBuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default (ctx: Context): ListrTask<Context, ListrRendererFactory, ListrRen
1010
updateLogContext({task: 'createBuild'});
1111

1212
try {
13-
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild, ctx.options.scheduled);
13+
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild, ctx.options.scheduled,ctx.env.LT_USERNAME,ctx.env.LT_ACCESS_KEY);
1414
if (resp && resp.data && resp.data.buildId) {
1515
ctx.build = {
1616
id: resp.data.buildId,

src/tasks/createBuildExec.ts

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

1313
try {
1414
if (ctx.authenticatedInitially && !ctx.config.skipBuildCreation) {
15-
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild, ctx.options.scheduled);
15+
let resp = await ctx.client.createBuild(ctx.git, ctx.config, ctx.log, ctx.build.name, ctx.isStartExec, ctx.env.SMART_GIT, ctx.options.markBaseline, ctx.options.baselineBuild, ctx.options.scheduled,ctx.env.LT_USERNAME,ctx.env.LT_ACCESS_KEY);
1616
if (resp && resp.data && resp.data.buildId) {
1717
ctx.build = {
1818
id: resp.data.buildId,

0 commit comments

Comments
 (0)