mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-17 18:26:44 +00:00
Actually run built image
This commit is contained in:
@@ -26,8 +26,9 @@ export async function runContainerStep(
|
||||
): Promise<number> {
|
||||
if (stepContainer.dockerfile) {
|
||||
const imagePath = `${generateBuildHandle()}/${generateBuildTag()}`
|
||||
await containerBuild(stepContainer, imagePath)
|
||||
throw new Error('Building container actions is not currently supported')
|
||||
const imageUrl = await containerBuild(stepContainer, imagePath)
|
||||
// throw new Error('Building container actions is not currently supported')
|
||||
stepContainer.image = imageUrl
|
||||
}
|
||||
|
||||
let secretName: string | undefined = undefined
|
||||
|
||||
@@ -488,11 +488,13 @@ export async function isPodContainerAlpine(
|
||||
export async function containerBuild(
|
||||
args: RunContainerStepArgs,
|
||||
imagePath: string
|
||||
): Promise<void> {
|
||||
): Promise<string> {
|
||||
const cm = registryConfigMap()
|
||||
const secret = registrySecret()
|
||||
const ss = registryStatefulSet()
|
||||
const svc = registryService()
|
||||
const port = svc?.spec?.ports?.[0]?.nodePort
|
||||
const registryUri = `localhost:${port}/${imagePath}`
|
||||
const pod = kanikoPod(args.workingDirectory, imagePath)
|
||||
await Promise.all([
|
||||
k8sApi.createNamespacedConfigMap(namespace(), cm),
|
||||
@@ -522,6 +524,7 @@ export async function containerBuild(
|
||||
console.log(JSON.stringify(err))
|
||||
throw err
|
||||
}
|
||||
return registryUri
|
||||
}
|
||||
|
||||
async function getCurrentNodeName(): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user