fixing cache folder

pull/310/head
Frostebite 2022-01-06 22:47:05 +00:00
parent 6a1b8387cb
commit 1c8c5e59b6
4 changed files with 15 additions and 2 deletions

View File

@ -79,6 +79,8 @@ jobs:
TARGET_PLATFORM: ${{ matrix.targetPlatform }} TARGET_PLATFORM: ${{ matrix.targetPlatform }}
- uses: ./ - uses: ./
id: aws-fargate-unity-build id: aws-fargate-unity-build
env:
INIT_HOOK: touch $GCP_LOG_FILE && tail -f $GCP_LOG_FILE | xargs -d '\n' -I{} gcloud logging write game-ci "{}" &
with: with:
cloudRunnerCluster: aws cloudRunnerCluster: aws
versioning: None versioning: None
@ -86,7 +88,6 @@ jobs:
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
githubToken: ${{ secrets.GITHUB_TOKEN }} githubToken: ${{ secrets.GITHUB_TOKEN }}
INIT_HOOK: touch $GCP_LOG_FILE && tail -f $GCP_LOG_FILE | xargs -d '\n' -I{} gcloud logging write game-ci "{}" &
postBuildSteps: | postBuildSteps: |
- name: upload - name: upload
image: amazon/aws-cli image: amazon/aws-cli

6
dist/index.js vendored
View File

@ -538,6 +538,7 @@ const remote_client_logger_1 = __webpack_require__(28082);
class Caching { class Caching {
static PushToCache(cacheFolder, sourceFolder, cacheKey) { static PushToCache(cacheFolder, sourceFolder, cacheKey) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const startPath = process.cwd();
try { try {
if (!fs_1.default.existsSync(cacheFolder)) { if (!fs_1.default.existsSync(cacheFolder)) {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`);
@ -565,12 +566,15 @@ class Caching {
} }
} }
catch (error) { catch (error) {
process.chdir(`${startPath}`);
throw error; throw error;
} }
process.chdir(`${startPath}`);
}); });
} }
static PullFromCache(cacheFolder, destinationFolder, cacheKey = ``) { static PullFromCache(cacheFolder, destinationFolder, cacheKey = ``) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const startPath = process.cwd();
remote_client_logger_1.RemoteClientLogger.log(`Caching for ${path_1.default.basename(destinationFolder)}`); remote_client_logger_1.RemoteClientLogger.log(`Caching for ${path_1.default.basename(destinationFolder)}`);
try { try {
if (!fs_1.default.existsSync(cacheFolder)) { if (!fs_1.default.existsSync(cacheFolder)) {
@ -607,8 +611,10 @@ class Caching {
} }
} }
catch (error) { catch (error) {
process.chdir(`${startPath}`);
throw error; throw error;
} }
process.chdir(`${startPath}`);
}); });
} }
static handleCachePurging() { static handleCachePurging() {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -10,6 +10,7 @@ import { RemoteClientLogger } from './remote-client-logger';
export class Caching { export class Caching {
public static async PushToCache(cacheFolder: string, sourceFolder: string, cacheKey: string) { public static async PushToCache(cacheFolder: string, sourceFolder: string, cacheKey: string) {
const startPath = process.cwd();
try { try {
if (!fs.existsSync(cacheFolder)) { if (!fs.existsSync(cacheFolder)) {
await CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`); await CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`);
@ -47,10 +48,13 @@ export class Caching {
await Caching.printFullCacheHierarchySize(); await Caching.printFullCacheHierarchySize();
} }
} catch (error) { } catch (error) {
process.chdir(`${startPath}`);
throw error; throw error;
} }
process.chdir(`${startPath}`);
} }
public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheKey: string = ``) { public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheKey: string = ``) {
const startPath = process.cwd();
RemoteClientLogger.log(`Caching for ${path.basename(destinationFolder)}`); RemoteClientLogger.log(`Caching for ${path.basename(destinationFolder)}`);
try { try {
if (!fs.existsSync(cacheFolder)) { if (!fs.existsSync(cacheFolder)) {
@ -90,8 +94,10 @@ export class Caching {
} }
} }
} catch (error) { } catch (error) {
process.chdir(`${startPath}`);
throw error; throw error;
} }
process.chdir(`${startPath}`);
} }
public static handleCachePurging() { public static handleCachePurging() {