cleanup
parent
1a0bc6d1ce
commit
7fd983757d
|
|
@ -4255,6 +4255,7 @@ class RemoteClient {
|
|||
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree -L 2 ${cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute}`);
|
||||
}
|
||||
if (fs_1.default.existsSync(path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.git`))) {
|
||||
process.chdir(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);
|
||||
remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute} repo exists - skipping clone - retained workspace mode ${cloud_runner_1.default.buildParameters.retainWorkspace}`);
|
||||
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git reset --hard ${cloud_runner_1.default.buildParameters.gitSha}`);
|
||||
return;
|
||||
|
|
@ -4323,7 +4324,7 @@ class RemoteClient {
|
|||
const fileContents = fs_1.default.readFileSync(path_1.default.join(gameCiCustomHooksPath, file), `utf8`);
|
||||
const fileContentsObject = yaml_1.default.parse(fileContents.toString());
|
||||
if (fileContentsObject.hook === hookLifecycle) {
|
||||
remote_client_logger_1.RemoteClientLogger.log(`Active Hook File ${file} contents: ${fileContents}`);
|
||||
remote_client_logger_1.RemoteClientLogger.log(`Active Hook File ${file} \n \n file contents: \n ${fileContents}`);
|
||||
yield cloud_runner_system_1.CloudRunnerSystem.Run(fileContentsObject.commands);
|
||||
}
|
||||
}
|
||||
|
|
@ -5534,16 +5535,16 @@ class BuildAutomationWorkflow {
|
|||
const retainedWorkspaceCommands = `if [ -e "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}" ] && [ -e "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.git`))}" ]; then echo "Retained Workspace Already Exists!" ; fi`;
|
||||
const cloneBuilderCommands = `if [ -e "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}" ] && [ -e "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, `.git`))}" ]; then echo "Builder Already Exists!"; else ${commands}; fi`;
|
||||
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
echo "game ci cloud runner clone"
|
||||
echo "downloading game-ci..."
|
||||
${retainedWorkspaceCommands}
|
||||
${cloneBuilderCommands}
|
||||
echo "game ci cloud runner bootstrap"
|
||||
echo "bootstrap game ci cloud runner..."
|
||||
node ${builderPath} -m remote-cli-pre-build`;
|
||||
}
|
||||
static BuildCommands(builderPath) {
|
||||
const distFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist');
|
||||
const ubuntuPlatformsFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
|
||||
return `echo "game ci cloud runner init"
|
||||
return `echo "game ci cloud runner initalized"
|
||||
mkdir -p ${`${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute)}/build`}
|
||||
cd ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute)}
|
||||
cp -r "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(path_1.default.join(distFolder, 'default-build-script'))}" "/UnityBuilderAction"
|
||||
|
|
@ -5551,9 +5552,9 @@ class BuildAutomationWorkflow {
|
|||
cp -r "${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(path_1.default.join(ubuntuPlatformsFolder, 'steps'))}" "/steps"
|
||||
chmod -R +x "/entrypoint.sh"
|
||||
chmod -R +x "/steps"
|
||||
echo "game ci cloud runner start"
|
||||
echo "game ci start"
|
||||
/entrypoint.sh
|
||||
echo "game ci cloud runner push library to cache"
|
||||
echo "game ci caching results"
|
||||
chmod +x ${builderPath}
|
||||
node ${builderPath} -m remote-cli-post-build`;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -69,6 +69,7 @@ export class RemoteClient {
|
|||
}
|
||||
|
||||
if (fs.existsSync(path.join(CloudRunnerFolders.repoPathAbsolute, `.git`))) {
|
||||
process.chdir(CloudRunnerFolders.repoPathAbsolute);
|
||||
RemoteClientLogger.log(
|
||||
`${CloudRunnerFolders.repoPathAbsolute} repo exists - skipping clone - retained workspace mode ${CloudRunner.buildParameters.retainWorkspace}`,
|
||||
);
|
||||
|
|
@ -144,7 +145,7 @@ export class RemoteClient {
|
|||
const fileContents = fs.readFileSync(path.join(gameCiCustomHooksPath, file), `utf8`);
|
||||
const fileContentsObject = YAML.parse(fileContents.toString());
|
||||
if (fileContentsObject.hook === hookLifecycle) {
|
||||
RemoteClientLogger.log(`Active Hook File ${file} contents: ${fileContents}`);
|
||||
RemoteClientLogger.log(`Active Hook File ${file} \n \n file contents: \n ${fileContents}`);
|
||||
await CloudRunnerSystem.Run(fileContentsObject.commands);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import CloudRunnerLogger from '../services/cloud-runner-logger';
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
import CloudRunnerOptions from '../cloud-runner-options';
|
||||
import setups from './cloud-runner-suite.test';
|
||||
import { CloudRunnerCustomSteps } from '../services/cloud-runner-custom-steps';
|
||||
|
||||
async function CreateParameters(overrides) {
|
||||
if (overrides) {
|
||||
|
|
@ -19,27 +18,8 @@ async function CreateParameters(overrides) {
|
|||
describe('Cloud Runner pre-built S3 steps', () => {
|
||||
it('Responds', () => {});
|
||||
setups();
|
||||
it('Check pre-built S3 steps', async () => {
|
||||
const yamlString = `hook: before
|
||||
commands: echo "test"`;
|
||||
const yamlString2 = `- hook: before
|
||||
commands: echo "test"`;
|
||||
const stringObject = CloudRunnerCustomSteps.ParseSteps(yamlString);
|
||||
const stringObject2 = CloudRunnerCustomSteps.ParseSteps(yamlString2);
|
||||
|
||||
CloudRunnerLogger.log(yamlString);
|
||||
CloudRunnerLogger.log(JSON.stringify(stringObject, undefined, 4));
|
||||
|
||||
expect(stringObject.length).toBe(1);
|
||||
expect(stringObject[0].hook).toBe(`before`);
|
||||
expect(stringObject2.length).toBe(1);
|
||||
expect(stringObject2[0].hook).toBe(`before`);
|
||||
|
||||
const getCustomStepsFromFiles = CloudRunnerCustomSteps.GetCustomStepsFromFiles(`before`);
|
||||
CloudRunnerLogger.log(JSON.stringify(getCustomStepsFromFiles, undefined, 4));
|
||||
});
|
||||
if (CloudRunnerOptions.cloudRunnerDebug && CloudRunnerOptions.cloudRunnerCluster !== `k8s`) {
|
||||
it('Run build once - check for pre and post custom hooks run contents', async () => {
|
||||
it('Run build and prebuilt s3 cache pull, cache push and upload build', async () => {
|
||||
const overrides = {
|
||||
versioning: 'None',
|
||||
projectPath: 'test-project',
|
||||
|
|
|
|||
|
|
@ -131,10 +131,10 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
|||
)}" ]; then echo "Builder Already Exists!"; else ${commands}; fi`;
|
||||
|
||||
return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
echo "game ci cloud runner clone"
|
||||
echo "downloading game-ci..."
|
||||
${retainedWorkspaceCommands}
|
||||
${cloneBuilderCommands}
|
||||
echo "game ci cloud runner bootstrap"
|
||||
echo "bootstrap game ci cloud runner..."
|
||||
node ${builderPath} -m remote-cli-pre-build`;
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
|||
const distFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist');
|
||||
const ubuntuPlatformsFolder = path.join(CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');
|
||||
|
||||
return `echo "game ci cloud runner init"
|
||||
return `echo "game ci cloud runner initalized"
|
||||
mkdir -p ${`${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.projectBuildFolderAbsolute)}/build`}
|
||||
cd ${CloudRunnerFolders.ToLinuxFolder(CloudRunnerFolders.projectPathAbsolute)}
|
||||
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(distFolder, 'default-build-script'))}" "/UnityBuilderAction"
|
||||
|
|
@ -150,9 +150,9 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
|||
cp -r "${CloudRunnerFolders.ToLinuxFolder(path.join(ubuntuPlatformsFolder, 'steps'))}" "/steps"
|
||||
chmod -R +x "/entrypoint.sh"
|
||||
chmod -R +x "/steps"
|
||||
echo "game ci cloud runner start"
|
||||
echo "game ci start"
|
||||
/entrypoint.sh
|
||||
echo "game ci cloud runner push library to cache"
|
||||
echo "game ci caching results"
|
||||
chmod +x ${builderPath}
|
||||
node ${builderPath} -m remote-cli-post-build`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue