Move shell scripts into remote-cli
parent
dae249cd4a
commit
8180c2c47d
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
repoPathFull=$1
|
||||
cloneUrl=$2
|
||||
|
||||
githubSha=$GITHUB_SHA
|
||||
|
||||
cd $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
|
||||
git clone $cloneUrl $repoPathFull
|
||||
git checkout $githubSha
|
||||
echo "Checked out $githubSha"
|
||||
|
||||
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
|
||||
md5sum .lfs-assets-guid > .lfs-assets-guid-sum
|
||||
export LFS_ASSETS_HASH="$(cat $repoPathFull/.lfs-assets-guid)"
|
||||
|
||||
echo ' '
|
||||
echo 'Contents of .lfs-assets-guid file:'
|
||||
cat .lfs-assets-guid
|
||||
|
||||
echo ' '
|
||||
echo 'Contents of .lfs-assets-guid-sum file:'
|
||||
cat .lfs-assets-guid-sum
|
||||
|
||||
echo ' '
|
||||
|
|
@ -1962,8 +1962,6 @@ class RemoteClientCli {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const buff = Buffer.from(process.env.SERIALIZED_BUILD_PARAMS || '', 'base64');
|
||||
const text = buff.toString('ascii');
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(text);
|
||||
cloud_runner_state_1.CloudRunnerState.setup(JSON.parse(text));
|
||||
switch (options.remoteClientState) {
|
||||
default:
|
||||
|
|
@ -2002,9 +2000,45 @@ class DownloadRepository {
|
|||
yield new Promise((promise) => {
|
||||
exec(`
|
||||
echo "test"
|
||||
apk update -q
|
||||
apk add unzip zip git-lfs jq tree -q
|
||||
${cloud_runner_state_1.CloudRunnerState.cloneBuilderCommand}
|
||||
mkdir -p ${cloud_runner_state_1.CloudRunnerState.buildPathFull}
|
||||
mkdir -p ${cloud_runner_state_1.CloudRunnerState.repoPathFull}
|
||||
echo ' '
|
||||
echo 'Initializing source repository for cloning with caching of LFS files'
|
||||
repoPathFull=${cloud_runner_state_1.CloudRunnerState.repoPathFull}
|
||||
cloneUrl=${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl}
|
||||
|
||||
githubSha=$GITHUB_SHA
|
||||
|
||||
cd $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
|
||||
git clone $cloneUrl $repoPathFull
|
||||
git checkout $githubSha
|
||||
echo "Checked out $githubSha"
|
||||
|
||||
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
|
||||
md5sum .lfs-assets-guid > .lfs-assets-guid-sum
|
||||
export LFS_ASSETS_HASH="$(cat $repoPathFull/.lfs-assets-guid)"
|
||||
|
||||
echo ' '
|
||||
echo 'Contents of .lfs-assets-guid file:'
|
||||
cat .lfs-assets-guid
|
||||
|
||||
echo ' '
|
||||
echo 'Contents of .lfs-assets-guid-sum file:'
|
||||
cat .lfs-assets-guid-sum
|
||||
|
||||
echo ' '
|
||||
# echo 'Source repository initialized'
|
||||
# ls ${cloud_runner_state_1.CloudRunnerState.projectPathFull}
|
||||
# echo ' '
|
||||
# echo 'Starting checks of cache for the Unity project Library and git LFS files'
|
||||
# ${cloud_runner_state_1.CloudRunnerState.getHandleCachingCommand}
|
||||
`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
|
@ -2241,12 +2275,9 @@ class CloudRunnerState {
|
|||
},
|
||||
];
|
||||
}
|
||||
static getHandleCachingCommand() {
|
||||
static get getHandleCachingCommand() {
|
||||
return `${CloudRunnerState.builderPathFull}/dist/cloud-runner/handleCaching.sh "${CloudRunnerState.cacheFolderFull}" "${CloudRunnerState.libraryFolderFull}" "${CloudRunnerState.lfsDirectory}" "${CloudRunnerState.purgeRemoteCaching}"`;
|
||||
}
|
||||
static getCloneNoLFSCommand() {
|
||||
return `${CloudRunnerState.builderPathFull}/dist/cloud-runner/cloneNoLFS.sh "${CloudRunnerState.repoPathFull}" "${CloudRunnerState.targetBuildRepoUrl}"`;
|
||||
}
|
||||
static get cloneBuilderCommand() {
|
||||
const cloneCommand = `git clone -b ${CloudRunnerState.branchName} ${CloudRunnerState.unityBuilderRepoUrl} ${CloudRunnerState.builderPathFull}`;
|
||||
cloud_runner_logger_1.default.log(cloneCommand);
|
||||
|
|
@ -2509,23 +2540,12 @@ class DownloadRepositoryStep {
|
|||
` printenv
|
||||
apk update -q
|
||||
apk add unzip zip git-lfs jq tree nodejs -q
|
||||
|
||||
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
# mkdir -p ${cloud_runner_state_1.CloudRunnerState.buildPathFull}
|
||||
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull}
|
||||
# mkdir -p ${cloud_runner_state_1.CloudRunnerState.repoPathFull}
|
||||
echo "${cloud_runner_state_1.CloudRunnerState.cloneBuilderCommand}"
|
||||
${cloud_runner_state_1.CloudRunnerState.cloneBuilderCommand}
|
||||
chmod +x ${cloud_runner_state_1.CloudRunnerState.builderPathFull}/dist/index.js
|
||||
node ${cloud_runner_state_1.CloudRunnerState.builderPathFull}/dist/index.js -m remote-cli
|
||||
# echo ' '
|
||||
# echo 'Initializing source repository for cloning with caching of LFS files'
|
||||
# ${cloud_runner_state_1.CloudRunnerState.getCloneNoLFSCommand()}
|
||||
# echo 'Source repository initialized'
|
||||
# ls ${cloud_runner_state_1.CloudRunnerState.projectPathFull}
|
||||
# echo ' '
|
||||
# echo 'Starting checks of cache for the Unity project Library and git LFS files'
|
||||
# ${cloud_runner_state_1.CloudRunnerState.getHandleCachingCommand()}
|
||||
`,
|
||||
], `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -5,8 +5,6 @@ export class RemoteClientCli {
|
|||
static async RunRemoteClient(options) {
|
||||
const buff = Buffer.from(process.env.SERIALIZED_BUILD_PARAMS || '', 'base64');
|
||||
const text = buff.toString('ascii');
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(text);
|
||||
CloudRunnerState.setup(JSON.parse(text));
|
||||
switch (options.remoteClientState) {
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -8,9 +8,45 @@ export class DownloadRepository {
|
|||
exec(
|
||||
`
|
||||
echo "test"
|
||||
apk update -q
|
||||
apk add unzip zip git-lfs jq tree -q
|
||||
${CloudRunnerState.cloneBuilderCommand}
|
||||
mkdir -p ${CloudRunnerState.buildPathFull}
|
||||
mkdir -p ${CloudRunnerState.repoPathFull}
|
||||
echo ' '
|
||||
echo 'Initializing source repository for cloning with caching of LFS files'
|
||||
repoPathFull=${CloudRunnerState.repoPathFull}
|
||||
cloneUrl=${CloudRunnerState.targetBuildRepoUrl}
|
||||
|
||||
githubSha=$GITHUB_SHA
|
||||
|
||||
cd $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
|
||||
git clone $cloneUrl $repoPathFull
|
||||
git checkout $githubSha
|
||||
echo "Checked out $githubSha"
|
||||
|
||||
git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid
|
||||
md5sum .lfs-assets-guid > .lfs-assets-guid-sum
|
||||
export LFS_ASSETS_HASH="$(cat $repoPathFull/.lfs-assets-guid)"
|
||||
|
||||
echo ' '
|
||||
echo 'Contents of .lfs-assets-guid file:'
|
||||
cat .lfs-assets-guid
|
||||
|
||||
echo ' '
|
||||
echo 'Contents of .lfs-assets-guid-sum file:'
|
||||
cat .lfs-assets-guid-sum
|
||||
|
||||
echo ' '
|
||||
# echo 'Source repository initialized'
|
||||
# ls ${CloudRunnerState.projectPathFull}
|
||||
# echo ' '
|
||||
# echo 'Starting checks of cache for the Unity project Library and git LFS files'
|
||||
# ${CloudRunnerState.getHandleCachingCommand}
|
||||
`,
|
||||
(error, stdout, stderr) => {
|
||||
if (error) {
|
||||
|
|
|
|||
|
|
@ -129,14 +129,10 @@ export class CloudRunnerState {
|
|||
];
|
||||
}
|
||||
|
||||
public static getHandleCachingCommand() {
|
||||
public static get getHandleCachingCommand() {
|
||||
return `${CloudRunnerState.builderPathFull}/dist/cloud-runner/handleCaching.sh "${CloudRunnerState.cacheFolderFull}" "${CloudRunnerState.libraryFolderFull}" "${CloudRunnerState.lfsDirectory}" "${CloudRunnerState.purgeRemoteCaching}"`;
|
||||
}
|
||||
|
||||
public static getCloneNoLFSCommand() {
|
||||
return `${CloudRunnerState.builderPathFull}/dist/cloud-runner/cloneNoLFS.sh "${CloudRunnerState.repoPathFull}" "${CloudRunnerState.targetBuildRepoUrl}"`;
|
||||
}
|
||||
|
||||
public static get cloneBuilderCommand() {
|
||||
const cloneCommand = `git clone -b ${CloudRunnerState.branchName} ${CloudRunnerState.unityBuilderRepoUrl} ${CloudRunnerState.builderPathFull}`;
|
||||
CloudRunnerLogger.log(cloneCommand);
|
||||
|
|
|
|||
|
|
@ -32,23 +32,12 @@ export class DownloadRepositoryStep implements StepInterface {
|
|||
` printenv
|
||||
apk update -q
|
||||
apk add unzip zip git-lfs jq tree nodejs -q
|
||||
|
||||
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
# mkdir -p ${CloudRunnerState.buildPathFull}
|
||||
mkdir -p ${CloudRunnerState.builderPathFull}
|
||||
# mkdir -p ${CloudRunnerState.repoPathFull}
|
||||
echo "${CloudRunnerState.cloneBuilderCommand}"
|
||||
${CloudRunnerState.cloneBuilderCommand}
|
||||
chmod +x ${CloudRunnerState.builderPathFull}/dist/index.js
|
||||
node ${CloudRunnerState.builderPathFull}/dist/index.js -m remote-cli
|
||||
# echo ' '
|
||||
# echo 'Initializing source repository for cloning with caching of LFS files'
|
||||
# ${CloudRunnerState.getCloneNoLFSCommand()}
|
||||
# echo 'Source repository initialized'
|
||||
# ls ${CloudRunnerState.projectPathFull}
|
||||
# echo ' '
|
||||
# echo 'Starting checks of cache for the Unity project Library and git LFS files'
|
||||
# ${CloudRunnerState.getHandleCachingCommand()}
|
||||
`,
|
||||
],
|
||||
`/${CloudRunnerState.buildVolumeFolder}`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue