Converting caching from shell to typescript

pull/310/head
Frostebite 2021-12-24 02:16:59 +00:00
parent c37771c360
commit 301e241147
3 changed files with 16 additions and 17 deletions

15
dist/index.js vendored
View File

@ -2021,18 +2021,17 @@ class DownloadRepository {
fs_1.default.mkdirSync(cloud_runner_state_1.CloudRunnerState.buildPathFull);
fs_1.default.mkdirSync(cloud_runner_state_1.CloudRunnerState.repoPathFull);
cloud_runner_logger_1.default.log(`Initializing source repository for cloning with caching of LFS files`);
process.chdir(cloud_runner_state_1.CloudRunnerState.repoPathFull);
// stop annoying git detatched head info
yield run_cli_1.RunCli.RunCli(`git config --global advice.detachedHead false`);
cloud_runner_logger_1.default.log(`Cloning the repository being built:`);
yield run_cli_1.RunCli.RunCli(`git lfs install --skip-smudge`);
cloud_runner_logger_1.default.log(cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl);
yield run_cli_1.RunCli.RunCli(`
cd ${cloud_runner_state_1.CloudRunnerState.repoPathFull}
# stop annoying git detatched head info
git config --global advice.detachedHead false
echo ' '
echo "Cloning the repository being built:"
git lfs install --skip-smudge
echo "${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl}"
git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${cloud_runner_state_1.CloudRunnerState.repoPathFull}
git checkout ${process.env.GITHUB_SHA}
echo "Checked out ${process.env.GITHUB_SHA}"
`);
cloud_runner_logger_1.default.log(`Checked out ${process.env.GITHUB_SHA}`);
yield run_cli_1.RunCli.RunCli(`
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
md5sum .lfs-assets-guid > .lfs-assets-guid-sum

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ import { RunCli } from '../run-cli';
import fs from 'fs';
import CloudRunnerLogger from '../../services/cloud-runner-logger';
import { CloudRunner } from '../../..';
export class DownloadRepository {
public static async run() {
@ -10,18 +11,17 @@ export class DownloadRepository {
fs.mkdirSync(CloudRunnerState.buildPathFull);
fs.mkdirSync(CloudRunnerState.repoPathFull);
CloudRunnerLogger.log(`Initializing source repository for cloning with caching of LFS files`);
process.chdir(CloudRunnerState.repoPathFull);
// stop annoying git detatched head info
await RunCli.RunCli(`git config --global advice.detachedHead false`);
CloudRunnerLogger.log(`Cloning the repository being built:`);
await RunCli.RunCli(`git lfs install --skip-smudge`);
CloudRunnerLogger.log(CloudRunnerState.targetBuildRepoUrl);
await RunCli.RunCli(`
cd ${CloudRunnerState.repoPathFull}
# stop annoying git detatched head info
git config --global advice.detachedHead false
echo ' '
echo "Cloning the repository being built:"
git lfs install --skip-smudge
echo "${CloudRunnerState.targetBuildRepoUrl}"
git clone ${CloudRunnerState.targetBuildRepoUrl} ${CloudRunnerState.repoPathFull}
git checkout ${process.env.GITHUB_SHA}
echo "Checked out ${process.env.GITHUB_SHA}"
`);
CloudRunnerLogger.log(`Checked out ${process.env.GITHUB_SHA}`);
await RunCli.RunCli(`
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
md5sum .lfs-assets-guid > .lfs-assets-guid-sum