Converting caching from shell to typescript
parent
c37771c360
commit
301e241147
|
|
@ -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.buildPathFull);
|
||||||
fs_1.default.mkdirSync(cloud_runner_state_1.CloudRunnerState.repoPathFull);
|
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`);
|
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(`
|
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 clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${cloud_runner_state_1.CloudRunnerState.repoPathFull}
|
||||||
git checkout ${process.env.GITHUB_SHA}
|
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(`
|
yield run_cli_1.RunCli.RunCli(`
|
||||||
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
|
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
|
||||||
md5sum .lfs-assets-guid > .lfs-assets-guid-sum
|
md5sum .lfs-assets-guid > .lfs-assets-guid-sum
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -3,6 +3,7 @@ import { RunCli } from '../run-cli';
|
||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import CloudRunnerLogger from '../../services/cloud-runner-logger';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger';
|
||||||
|
import { CloudRunner } from '../../..';
|
||||||
|
|
||||||
export class DownloadRepository {
|
export class DownloadRepository {
|
||||||
public static async run() {
|
public static async run() {
|
||||||
|
|
@ -10,18 +11,17 @@ export class DownloadRepository {
|
||||||
fs.mkdirSync(CloudRunnerState.buildPathFull);
|
fs.mkdirSync(CloudRunnerState.buildPathFull);
|
||||||
fs.mkdirSync(CloudRunnerState.repoPathFull);
|
fs.mkdirSync(CloudRunnerState.repoPathFull);
|
||||||
CloudRunnerLogger.log(`Initializing source repository for cloning with caching of LFS files`);
|
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(`
|
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 clone ${CloudRunnerState.targetBuildRepoUrl} ${CloudRunnerState.repoPathFull}
|
||||||
git checkout ${process.env.GITHUB_SHA}
|
git checkout ${process.env.GITHUB_SHA}
|
||||||
echo "Checked out ${process.env.GITHUB_SHA}"
|
|
||||||
`);
|
`);
|
||||||
|
CloudRunnerLogger.log(`Checked out ${process.env.GITHUB_SHA}`);
|
||||||
await RunCli.RunCli(`
|
await RunCli.RunCli(`
|
||||||
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
|
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
|
||||||
md5sum .lfs-assets-guid > .lfs-assets-guid-sum
|
md5sum .lfs-assets-guid > .lfs-assets-guid-sum
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue