Install shared deps into composite image

This commit is contained in:
Radon Rosborough 2021-01-16 09:56:59 -08:00
parent 471f18e567
commit e848cc2792
2 changed files with 13 additions and 3 deletions

View File

@ -17,6 +17,10 @@ export DEBIAN_FRONTEND=noninteractive
apt-get update apt-get update
riju-curl /shared | while read lang; do
riju-apt-install "/fs/build/shared/${lang}/riju-shared-${lang}.deb"
done
riju-curl /langs | while read lang; do riju-curl /langs | while read lang; do
riju-apt-install "/fs/build/lang/${lang}/riju-lang-${lang}.deb" riju-apt-install "/fs/build/lang/${lang}/riju-lang-${lang}.deb"
riju-apt-install "/fs/build/config/${lang}/riju-config-${lang}.deb" riju-apt-install "/fs/build/config/${lang}/riju-config-${lang}.deb"

View File

@ -3,7 +3,7 @@ import http from "http";
import express from "express"; import express from "express";
import { getLangs, getPackages } from "./config.js"; import { getLangs, getPackages, getSharedDeps } from "./config.js";
import { getLocalImageLabel } from "./docker-util.js"; import { getLocalImageLabel } from "./docker-util.js";
import { hashDockerfile } from "./hash-dockerfile.js"; import { hashDockerfile } from "./hash-dockerfile.js";
import { runCommand } from "./util.js"; import { runCommand } from "./util.js";
@ -11,11 +11,14 @@ import { runCommand } from "./util.js";
// Get a Node.js http server object that will serve information and // Get a Node.js http server object that will serve information and
// files for packages that should be installed into the composite // files for packages that should be installed into the composite
// Docker image. // Docker image.
function getServer(langs) { function getServer({ langs, sharedDeps }) {
const app = express(); const app = express();
app.get("/langs", (req, res) => { app.get("/langs", (req, res) => {
res.send(langs.map((lang) => lang + "\n").join("")); res.send(langs.map((lang) => lang + "\n").join(""));
}); });
app.get("/shared", (req, res) => {
res.send(sharedDeps.map((lang) => lang + "\n").join(""));
});
app.use("/fs", express.static(".")); app.use("/fs", express.static("."));
return http.createServer(app); return http.createServer(app);
} }
@ -46,7 +49,10 @@ async function main() {
}, },
} }
); );
const server = getServer(await getLangs()); const server = getServer({
langs: await getLangs(),
sharedDeps: await getSharedDeps(),
});
await new Promise((resolve) => server.listen(8487, "localhost", resolve)); await new Promise((resolve) => server.listen(8487, "localhost", resolve));
try { try {
await runCommand( await runCommand(