mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Update scripts reference to Dockerfile
This commit is contained in:
parent
81a7bbbe88
commit
18488f9b04
File diff suppressed because one or more lines are too long
@ -8,11 +8,11 @@ const core = require('@actions/core');
|
||||
async function action() {
|
||||
Action.checkCompatibility();
|
||||
|
||||
const { dockerfile, workspace, rootFolder } = Action;
|
||||
const { dockerfile, workspace, builderFolder } = Action;
|
||||
const { version, platform, projectPath, buildName, buildsPath, method } = Input.getFromUser();
|
||||
|
||||
const baseImage = new ImageTag({ version, platform });
|
||||
const builtImage = await Docker.build({ path: rootFolder, dockerfile, baseImage });
|
||||
const builtImage = await Docker.build({ path: builderFolder, dockerfile, baseImage });
|
||||
|
||||
await Docker.run(builtImage, { workspace, platform, projectPath, buildName, buildsPath, method });
|
||||
}
|
||||
|
@ -25,8 +25,12 @@ export default class Action {
|
||||
return path.dirname(path.dirname(__filename));
|
||||
}
|
||||
|
||||
static get builderFolder() {
|
||||
return `${Action.rootFolder}/builder`;
|
||||
}
|
||||
|
||||
static get dockerfile() {
|
||||
return `${Action.rootFolder}/Dockerfile`;
|
||||
return `${Action.builderFolder}/Dockerfile`;
|
||||
}
|
||||
|
||||
static get workspace() {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import Action from './action';
|
||||
|
||||
describe('Action', () => {
|
||||
@ -16,5 +17,20 @@ describe('Action', () => {
|
||||
const { rootFolder, name } = Action;
|
||||
|
||||
expect(path.basename(rootFolder)).toStrictEqual(name);
|
||||
expect(fs.existsSync(rootFolder)).toStrictEqual(true);
|
||||
});
|
||||
|
||||
it('returns the builder folder', () => {
|
||||
const { builderFolder } = Action;
|
||||
|
||||
expect(path.basename(builderFolder)).toStrictEqual('builder');
|
||||
expect(fs.existsSync(builderFolder)).toStrictEqual(true);
|
||||
});
|
||||
|
||||
it('returns the docker file', () => {
|
||||
const { dockerfile } = Action;
|
||||
|
||||
expect(path.basename(dockerfile)).toStrictEqual('Dockerfile');
|
||||
expect(fs.existsSync(dockerfile)).toStrictEqual(true);
|
||||
});
|
||||
});
|
||||
|
@ -4,7 +4,7 @@ import ImageTag from './image-tag';
|
||||
|
||||
describe('Docker', () => {
|
||||
it('builds', async () => {
|
||||
const path = Action.rootFolder;
|
||||
const path = Action.builderFolder;
|
||||
const dockerfile = `${path}/Dockerfile`;
|
||||
const baseImage = new ImageTag({
|
||||
repository: '',
|
||||
|
Loading…
Reference in New Issue
Block a user