fixing xargs too many args

pull/310/head
Frostebite 2022-01-02 22:27:03 +00:00
parent 26e4298f41
commit 656675a184
4 changed files with 92 additions and 92 deletions

View File

@ -78,7 +78,7 @@ jobs:
AWS_DEFAULT_REGION: eu-west-2
DEBUG: true
GCP_LOG_FILE: ${{ github.workspace }}/cloud-runner-logs
INIT_HOOK: touch $GCP_LOG_FILE && tail -f $GCP_LOG_FILE | xargs -I{} gcloud logging write game-ci "{}"
INIT_HOOK: touch $GCP_LOG_FILE && tail -f $GCP_LOG_FILE | xargs -I{} gcloud logging write game-ci {}
with:
cloudRunnerCluster: aws
versioning: None

View File

@ -99,7 +99,7 @@ jobs:
CloudRunnerBranch: remote-builder/unified-providers
DEBUG: true
GCP_LOG_FILE: ${{ github.workspace }}/cloud-runner-logs
INIT_HOOK: touch $GCP_LOG_FILE && tail -f $GCP_LOG_FILE | xargs -I{} gcloud logging write game-ci "{}"
INIT_HOOK: touch $GCP_LOG_FILE && tail -f $GCP_LOG_FILE | xargs -I{} gcloud logging write game-ci {}
with:
cloudRunnerCluster: k8s
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

178
dist/index.js vendored
View File

@ -339,10 +339,10 @@ class Cache {
if (action_1.default.isRunningLocally) {
return;
}
core.warning(`
Library folder does not exist.
Consider setting up caching to speed up your workflow,
if this is not your first build.
core.warning(`
Library folder does not exist.
Consider setting up caching to speed up your workflow,
if this is not your first build.
`);
}
}
@ -488,8 +488,8 @@ class CLI {
static runRemoteClientJob() {
return __awaiter(this, void 0, void 0, function* () {
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
remote_client_logger_1.RemoteClientLogger.log(`Build Params:
${JSON.stringify(buildParameter, undefined, 4)}
remote_client_logger_1.RemoteClientLogger.log(`Build Params:
${JSON.stringify(buildParameter, undefined, 4)}
`);
cloud_runner_state_1.CloudRunnerState.setup(buildParameter);
yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run();
@ -609,18 +609,18 @@ class Caching {
}
static printFullCacheHierarchySize() {
return __awaiter(this, void 0, void 0, function* () {
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`echo ' '
echo "LFS cache for $branch"
du -sch "${cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull}/"
echo '**'
echo "Library cache for $branch"
du -sch "${cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull}/"
echo '**'
echo "Branch: $branch"
du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/"
echo '**'
echo 'Full cache'
du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/.."
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`echo ' '
echo "LFS cache for $branch"
du -sch "${cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull}/"
echo '**'
echo "Library cache for $branch"
du -sch "${cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull}/"
echo '**'
echo "Branch: $branch"
du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/"
echo '**'
echo 'Full cache'
du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/.."
echo ' '`);
});
}
@ -1483,25 +1483,25 @@ exports.AWSTemplates = void 0;
const fs = __importStar(__webpack_require__(35747));
class AWSTemplates {
static getParameterTemplate(p1) {
return `
${p1}:
Type: String
Default: ''
return `
${p1}:
Type: String
Default: ''
`;
}
static getSecretTemplate(p1) {
return `
${p1}Secret:
Type: AWS::SecretsManager::Secret
Properties:
Name: '${p1}'
SecretString: !Ref ${p1}
return `
${p1}Secret:
Type: AWS::SecretsManager::Secret
Properties:
Name: '${p1}'
SecretString: !Ref ${p1}
`;
}
static getSecretDefinitionTemplate(p1, p2) {
return `
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
return `
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
`;
}
static insertAtTemplate(template, insertionKey, insertion) {
@ -2087,8 +2087,8 @@ class KubernetesJobSpecFactory {
command: [
'bin/bash',
'-c',
`cd /data/builder/action/steps;
chmod +x /return_license.sh;
`cd /data/builder/action/steps;
chmod +x /return_license.sh;
/return_license.sh;`,
],
},
@ -2506,15 +2506,15 @@ const yaml_1 = __importDefault(__webpack_require__(13552));
class CloudRunnerBuildCommandProcessor {
static ProcessCommands(commands, buildParameters) {
const hooks = CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`all`));
return `echo "---"
echo "start cloud runner init"
${__1.Input.cloudRunnerTests ? '' : '#'} printenv
echo "start cloud runner job"
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
${commands}
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
echo "end of cloud runner job
---${buildParameters.logId}"
return `echo "---"
echo "start cloud runner init"
${__1.Input.cloudRunnerTests ? '' : '#'} printenv
echo "start cloud runner job"
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
${commands}
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
echo "end of cloud runner job
---${buildParameters.logId}"
`;
}
static getHooks() {
@ -2894,32 +2894,32 @@ class BuildStep {
cloud_runner_logger_1.default.logLine(` `);
cloud_runner_logger_1.default.logLine('Starting part 2/2 (build unity project)');
const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`));
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GITHUB_WORKSPACE="${cloud_runner_state_1.CloudRunnerState.repoPathFull}"
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GITHUB_WORKSPACE="${cloud_runner_state_1.CloudRunnerState.repoPathFull}"
cp -r "${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'default-build-script')
.replace(/\\/g, `/`)}" "/UnityBuilderAction"
.replace(/\\/g, `/`)}" "/UnityBuilderAction"
cp -r "${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh')
.replace(/\\/g, `/`)}" "/entrypoint.sh"
cp -r "${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'steps').replace(/\\/g, `/`)}" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
/entrypoint.sh
apt-get update
apt-get install -y -q zip tree
cd "${cloud_runner_state_1.CloudRunnerState.libraryFolderFull.replace(/\\/g, `/`)}/.."
zip -r "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "Library"
mv "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/lib"
cd "${cloud_runner_state_1.CloudRunnerState.repoPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
zip -r "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "build"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
mv "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}"
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
.replace(/\\/g, `/`)}" "/entrypoint.sh"
cp -r "${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'steps').replace(/\\/g, `/`)}" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
/entrypoint.sh
apt-get update
apt-get install -y -q zip tree
cd "${cloud_runner_state_1.CloudRunnerState.libraryFolderFull.replace(/\\/g, `/`)}/.."
zip -r "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "Library"
mv "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/lib"
cd "${cloud_runner_state_1.CloudRunnerState.repoPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
zip -r "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "build"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
mv "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}"
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.projectPathFull}`, environmentVariables, secrets);
});
}
@ -2970,18 +2970,18 @@ class SetupStep {
cloud_runner_logger_1.default.log(` `);
cloud_runner_logger_1.default.logLine('Starting step 1/2 (setup game files from repository)');
const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`));
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
apk update -q
apk add unzip zip git-lfs jq tree nodejs -q
${__1.Input.cloudRunnerTests ? '' : '#'} apk add tree -q
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
apk update -q
apk add unzip zip git-lfs jq tree nodejs -q
${__1.Input.cloudRunnerTests ? '' : '#'} apk add tree -q
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets);
}
catch (error) {
@ -3206,9 +3206,9 @@ class Docker {
const { path, dockerfile, baseImage } = buildParameters;
const { version, platform } = baseImage;
const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });
const command = `docker build ${path} \
--file ${dockerfile} \
--build-arg IMAGE=${baseImage} \
const command = `docker build ${path} \
--file ${dockerfile} \
--build-arg IMAGE=${baseImage} \
--tag ${tag}`;
yield exec_1.exec(command, undefined, { silent });
return tag;
@ -3217,16 +3217,16 @@ class Docker {
static run(image, parameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () {
const { workspace, runnerTempPath, sshAgent } = parameters;
const command = `docker run \
--workdir /github/workspace \
--rm \
${image_environment_factory_1.default.getEnvVarString(parameters)} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "${runnerTempPath}/_github_home":"/root" \
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
--volume "${workspace}":"/github/workspace" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
const command = `docker run \
--workdir /github/workspace \
--rm \
${image_environment_factory_1.default.getEnvVarString(parameters)} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "${runnerTempPath}/_github_home":"/root" \
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
--volume "${workspace}":"/github/workspace" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
${image}`;
yield exec_1.exec(command, undefined, { silent });
});

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long