This commit is contained in:
Andras Bacsai
2022-12-01 09:51:56 +01:00
parent 9d3ed85ffd
commit 12c0760cb3
6 changed files with 16 additions and 24 deletions

View File

@@ -30,16 +30,15 @@ export default async function ({
}): Promise<string> {
const { default: got } = await import('got')
const url = htmlUrl.replace('https://', '').replace('http://', '');
await saveBuildLog({ line: 'Importer | Warming up GitHub importer.', buildId, applicationId });
if (forPublic) {
await saveBuildLog({
line: `Importer | Cloning ${repository}:${branch} branch.`,
line: `Cloning ${repository}:${branch} branch`,
buildId,
applicationId
});
if (gitCommitHash) {
await saveBuildLog({
line: `Importer | Checking out ${gitCommitHash} commit.`,
line: `Checking out ${gitCommitHash} commit`,
buildId,
applicationId
});
@@ -71,13 +70,13 @@ export default async function ({
})
.json();
await saveBuildLog({
line: `Importer | Cloning ${repository}:${branch} branch.`,
line: `Cloning ${repository}:${branch} branch`,
buildId,
applicationId
});
if (gitCommitHash) {
await saveBuildLog({
line: `Importer | Checking out ${gitCommitHash} commit.`,
line: `Checking out ${gitCommitHash} commit`,
buildId,
applicationId
});

View File

@@ -27,21 +27,19 @@ export default async function ({
forPublic: boolean;
}): Promise<string> {
const url = htmlUrl.replace('https://', '').replace('http://', '').replace(/\/$/, '');
await saveBuildLog({ line: 'Importer | Warming up GitLab importer.', buildId, applicationId });
if (!forPublic) {
await asyncExecShell(`echo '${privateSshKey}' > ${repodir}/id.rsa`);
await asyncExecShell(`chmod 600 ${repodir}/id.rsa`);
}
await saveBuildLog({
line: `Importer | Cloning ${repository}:${branch} branch.`,
line: `Cloning ${repository}:${branch} branch`,
buildId,
applicationId
});
if (gitCommitHash) {
await saveBuildLog({
line: `Importer | Checking out ${gitCommitHash} commit.`,
line: `Checking out ${gitCommitHash} commit`,
buildId,
applicationId
});