Skip to content

Commit 8eba3c1

Browse files
satota2shimos
authored andcommitted
fix(integration): Read git user settings from environment variables for K8s tests
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
1 parent e467cf4 commit 8eba3c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

integration/steps/fabric-network-deployment.steps.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,23 @@ export class FabricNetworkDeploymentSteps extends BaseStepClass {
154154
});
155155
}
156156

157+
private setGitUserInfo() {
158+
if (!process.env.GIT_USER || !process.env.GIT_PASSWORD) return;
159+
160+
const commandsList = [
161+
`kubectl -n test-network delete secret git || true`,
162+
`kubectl -n test-network create secret generic git --from-literal=username="${process.env.GIT_USER}" --from-literal=password="${process.env.GIT_PASSWORD}"`];
163+
164+
for (const commands of commandsList) {
165+
execSync(commands, {
166+
cwd: this.pathToExample(),
167+
env: {
168+
...process.env,
169+
}
170+
});
171+
}
172+
}
173+
157174
private loadDockerImagesForOpsSCIntoKIND() {
158175
const imageNames = [`fabric-opssc/opssc-api-server:${FabricNetworkDeploymentSteps.opsSCImageTag()}`,
159176
`fabric-opssc/opssc-agent:${FabricNetworkDeploymentSteps.opsSCImageTag()}`];
@@ -242,6 +259,7 @@ export class FabricNetworkDeploymentSteps extends BaseStepClass {
242259
...envs,
243260
}
244261
});
262+
this.setGitUserInfo();
245263
}
246264

247265
@given(/create (.+) channel/, 'on-k8s')

0 commit comments

Comments
 (0)