fix linting errors
parent
02bb450d73
commit
baa853a94d
|
|
@ -2,15 +2,15 @@ import { exec } from '@actions/exec';
|
||||||
import ImageTag from './image-tag';
|
import ImageTag from './image-tag';
|
||||||
import ImageEnvironmentFactory from './image-environment-factory';
|
import ImageEnvironmentFactory from './image-environment-factory';
|
||||||
import { existsSync, mkdirSync } from 'fs';
|
import { existsSync, mkdirSync } from 'fs';
|
||||||
import { join } from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
class Docker {
|
class Docker {
|
||||||
static async build(buildParameters, silent = false) {
|
static async build(buildParameters, silent = false) {
|
||||||
const { path, dockerfile, baseImage } = buildParameters;
|
const { path: buildPath, dockerfile, baseImage } = buildParameters;
|
||||||
const { version, platform } = baseImage;
|
const { version, platform } = baseImage;
|
||||||
|
|
||||||
const tag = new ImageTag({ repository: '', name: 'unity-builder', version, platform });
|
const tag = new ImageTag({ repository: '', name: 'unity-builder', version, platform });
|
||||||
const command = `docker build ${path} \
|
const command = `docker build ${buildPath} \
|
||||||
--file ${dockerfile} \
|
--file ${dockerfile} \
|
||||||
--build-arg IMAGE=${baseImage} \
|
--build-arg IMAGE=${baseImage} \
|
||||||
--tag ${tag}`;
|
--tag ${tag}`;
|
||||||
|
|
@ -43,21 +43,22 @@ class Docker {
|
||||||
|
|
||||||
static getBaseOsSpecificArguments(baseOs, workspace, unitySerial, runnerTemporaryPath, sshAgent): string {
|
static getBaseOsSpecificArguments(baseOs, workspace, unitySerial, runnerTemporaryPath, sshAgent): string {
|
||||||
switch (baseOs) {
|
switch (baseOs) {
|
||||||
case 'linux':
|
case 'linux': {
|
||||||
const github_home = join(runnerTemporaryPath, '_github_home');
|
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
||||||
if (!existsSync(github_home)) mkdirSync(github_home);
|
if (!existsSync(githubHome)) mkdirSync(githubHome);
|
||||||
const github_workflow = join(runnerTemporaryPath, '_github_workflow');
|
const githubWorkflow = path.join(runnerTemporaryPath, '_github_workflow');
|
||||||
if (!existsSync(github_workflow)) mkdirSync(github_workflow);
|
if (!existsSync(githubWorkflow)) mkdirSync(githubWorkflow);
|
||||||
|
|
||||||
return `--env UNITY_SERIAL \
|
return `--env UNITY_SERIAL \
|
||||||
--env GITHUB_WORKSPACE=/github/workspace \
|
--env GITHUB_WORKSPACE=/github/workspace \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "/var/run/docker.sock":"/var/run/docker.sock:z" \
|
--volume "/var/run/docker.sock":"/var/run/docker.sock:z" \
|
||||||
--volume "${github_home}":"/root:z" \
|
--volume "${githubHome}":"/root:z" \
|
||||||
--volume "${github_workflow}":"/github/workflow:z" \
|
--volume "${githubWorkflow}":"/github/workflow:z" \
|
||||||
--volume "${workspace}":"/github/workspace:z" \
|
--volume "${workspace}":"/github/workspace:z" \
|
||||||
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||||
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''}`;
|
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''}`;
|
||||||
|
}
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return `--env UNITY_SERIAL="${unitySerial}" \
|
return `--env UNITY_SERIAL="${unitySerial}" \
|
||||||
--env GITHUB_WORKSPACE=c:/github/workspace \
|
--env GITHUB_WORKSPACE=c:/github/workspace \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue