This commit is contained in:
TingluoHuang
2021-10-28 19:01:29 -04:00
parent ca3b803237
commit 658d36c1bc
3 changed files with 20 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
name: Docker Image CI
on:
push:
workflow_dispatch:

View File

@@ -76,7 +76,7 @@ async function run(): Promise<void> {
// copy over node.js
const cpNodeArgs = [
'cp',
'../externals/node16/bin',
'/actions-runner/externals/node16/bin',
'job-container:/__runner_util/'
]
await exec.exec('kubectl', cpNodeArgs)
@@ -84,14 +84,14 @@ async function run(): Promise<void> {
// copy over innerhandler
const cpKubeInnerArgs = [
'cp',
'./kubeInnerHandler',
'/actions-runner/bin/kubeInnerHandler',
'job-container:/__runner_util/kubeInnerHandler'
]
await exec.exec('kubectl', cpKubeInnerArgs)
const creationOutput = {
JobContainerId: 'job-container'
// Network: "job-container"
JobContainerId: 'job-container',
Network: 'job-container'
}
const output = JSON.stringify({CreationOutput: creationOutput})

View File

@@ -3044,13 +3044,22 @@ function run() {
// get PATH inside the container
// output containerId for ${{job.container.id}}
// copy over node.js
const cpNodeArgs = ['cp', '../externals/node16/bin', 'job-container:/__runner_util/'];
const cpNodeArgs = [
'cp',
'/actions-runner/externals/node16/bin',
'job-container:/__runner_util/'
];
yield exec.exec('kubectl', cpNodeArgs);
// copy over innerhandler
const cpKubeInnerArgs = ['cp', './kubeInnerHandler', 'job-container:/__runner_util/kubeInnerHandler'];
const cpKubeInnerArgs = [
'cp',
'/actions-runner/bin/kubeInnerHandler',
'job-container:/__runner_util/kubeInnerHandler'
];
yield exec.exec('kubectl', cpKubeInnerArgs);
const creationOutput = {
JobContainerId: "job-container",
JobContainerId: 'job-container',
Network: "job-container"
};
const output = JSON.stringify({ CreationOutput: creationOutput });
core.debug(output);
@@ -3085,7 +3094,9 @@ function run() {
execArgs.push('/__runner_util/node');
execArgs.push('/__runner_util/kubeInnerHandler');
core.debug(JSON.stringify(execArgs));
yield exec.exec('kubectl', execArgs, { input: Buffer.from(JSON.stringify(execInput)) });
yield exec.exec('kubectl', execArgs, {
input: Buffer.from(JSON.stringify(execInput))
});
}
});
}