23 lines
		
	
	
	
		
			760 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			760 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
#!/usr/bin/env bun
 | 
						|
const $ = Bun.$;
 | 
						|
 | 
						|
const sharedDir = import.meta.dir;
 | 
						|
const tag = process.argv[2];
 | 
						|
const dirName = process.argv[3];
 | 
						|
const arches = process.argv[4].split(",");
 | 
						|
const pathToDnfCache = process.env["DNF_CACHE_PATH"];
 | 
						|
 | 
						|
const stag = tag.split('/');
 | 
						|
const imageName = stag[stag.length - 1];
 | 
						|
const tempTag = `localhost/runner-images/${imageName}`;
 | 
						|
 | 
						|
await $`buildah manifest create ${tag}`;
 | 
						|
for (const arch of arches) {
 | 
						|
    await $`buildah build --arch ${arch} \
 | 
						|
            --pid=host --ipc=host --network=host --userns=host \
 | 
						|
            --uts=host ${pathToDnfCache ? `-v${pathToDnfCache}:/var/cache/dnf:O` : ""} \
 | 
						|
            --manifest ${tag} \
 | 
						|
            --volume ${sharedDir}:/imgbuild:z ${dirName}`;
 | 
						|
}
 | 
						|
 | 
						|
await $`buildah tag ${tag} ${tempTag}`;
 |