pass all arguments along to build container
This commit is contained in:
parent
ddbe2d042e
commit
729dc98887
@ -129,12 +129,16 @@ class BuildController extends EventEmitter {
|
||||
}
|
||||
|
||||
private createBuildParams = (build: Build) => {
|
||||
// TODO: implement patch
|
||||
const params = ['run', '--rm', '-e', `REPO=${build.repo}`];
|
||||
if (build.dependencies) {
|
||||
params.push('-e', `DEP=${build.dependencies}`);
|
||||
}
|
||||
if (build.commit) {
|
||||
// TODO: implement COMMIT
|
||||
params.push('-e', `COMMIT=${build.commit}`);
|
||||
}
|
||||
if (build.patch) {
|
||||
params.push('-e', `PATCH=${build.patch}`);
|
||||
}
|
||||
params.push('--name', getContainerName(build.id));
|
||||
params.push(docker_images[build.distro]);
|
||||
return params;
|
||||
|
@ -233,7 +233,6 @@ class DB {
|
||||
|
||||
public async dequeue(): Promise<Build> {
|
||||
return await this.build.findOne({
|
||||
attributes: SELECT,
|
||||
order: [['id', 'ASC']],
|
||||
where: {
|
||||
status: 'queued'
|
||||
|
@ -145,6 +145,15 @@ class Web {
|
||||
res.set('Content-Type', 'text/plain').send(log);
|
||||
});
|
||||
|
||||
app.get('/build/:num/patch/?', async (req, res) => {
|
||||
const build = await this.db.getBuild(parseInt(req.params.num));
|
||||
if (!build || !build.patch) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
res.set('Content-Type', 'text/plain').send(build.patch);
|
||||
});
|
||||
|
||||
app.get('/healthcheck', (_, res) => {
|
||||
res.send('Healthy');
|
||||
});
|
||||
|
@ -2,7 +2,7 @@
|
||||
<footer>
|
||||
<ul>
|
||||
<li>Developed by Cory Sanin</li>
|
||||
<li><a href="/?TODO">Source</a></li>
|
||||
<li><a href="https://github.com/CorySanin/archery">Source</a></li>
|
||||
</ul>
|
||||
</footer>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user