Feature/support for unity licensing server linux (#468)

* Initial support for adding a UNITY_LICENSING_SERVER parameter to build parameters

* Test to figure out what the working directory is of current bash script

* Outputting current directory and using $ACTION_FOLDER

* Add resources folder to mounted docker volumes. Used by activation script to copy over template file for unity licensing server

* use awk instead of sed due to http characters breaking syntax

* mkdir for unity config

* Add -p flag to mkdir so parents are also created if missing

* Initial work on returning floating license when using licensing server

* Checking licensing server first for now, since serial is always set

* Parse and save acquired floating license for use for returning after build

* Clean up duplicate commands in activate.sh

* Fixed running string as command, use it as input instead

* Fixed cloud runner tests failing when using a ssh remote.

* Clean up of test files and unnecessary logging

* Moved process of generating services-config.json file from platform specific activate scripts to typescript

* Fixed path
This commit is contained in:
simensan
2022-10-22 18:55:58 +02:00
committed by GitHub
parent 9f79830454
commit 4cb3e593f5
15 changed files with 206 additions and 51 deletions

View File

@@ -1,8 +1,24 @@
import { GitRepoReader } from './git-repo';
import { CloudRunnerSystem } from '../cloud-runner/services/cloud-runner-system';
import Input from '../input';
describe(`git repo tests`, () => {
it(`Branch value parsed from CLI to not contain illegal characters`, async () => {
expect(await GitRepoReader.GetBranch()).not.toContain(`\n`);
expect(await GitRepoReader.GetBranch()).not.toContain(` `);
});
it(`returns valid branch name when using https`, async () => {
const mockValue = 'https://github.com/example/example.git';
await jest.spyOn(CloudRunnerSystem, 'Run').mockReturnValue(Promise.resolve(mockValue));
await jest.spyOn(Input, 'cloudRunnerCluster', 'get').mockReturnValue('not-local');
expect(await GitRepoReader.GetRemote()).toEqual(`example/example`);
});
it(`returns valid branch name when using ssh`, async () => {
const mockValue = 'git@github.com:example/example.git';
await jest.spyOn(CloudRunnerSystem, 'Run').mockReturnValue(Promise.resolve(mockValue));
await jest.spyOn(Input, 'cloudRunnerCluster', 'get').mockReturnValue('not-local');
expect(await GitRepoReader.GetRemote()).toEqual(`example/example`);
});
});

View File

@@ -14,7 +14,7 @@ export class GitRepoReader {
CloudRunnerLogger.log(`value ${value}`);
assert(value.includes('github.com'));
return value.split('github.com/')[1].split('.git')[0];
return value.split('github.com')[1].split('.git')[0].slice(1);
}
public static async GetBranch() {