Ensure folders are created
							parent
							
								
									80baa8d054
								
							
						
					
					
						commit
						777186b015
					
				|  | @ -1,6 +1,8 @@ | ||||||
| import { exec } from '@actions/exec'; | 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 { join } from 'path'; | ||||||
| 
 | 
 | ||||||
| class Docker { | class Docker { | ||||||
|   static async build(buildParameters, silent = false) { |   static async build(buildParameters, silent = false) { | ||||||
|  | @ -42,12 +44,17 @@ 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"); | ||||||
|  |         existsSync(github_home) || mkdirSync(github_home); | ||||||
|  |         const github_workflow = join(runnerTemporaryPath, "_github_workflow"); | ||||||
|  |         existsSync(github_workflow) || mkdirSync(github_workflow); | ||||||
|  | 
 | ||||||
|         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 "${runnerTemporaryPath}/_github_home":"/root:z" \ |                 --volume "${github_home}":"/root:z" \ | ||||||
|                 --volume "${runnerTemporaryPath}/_github_workflow":"/github/workflow:z" \ |                 --volume "${github_workflow}":"/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' : ''}`;
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue