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) => {
|
private createBuildParams = (build: Build) => {
|
||||||
// TODO: implement patch
|
|
||||||
const params = ['run', '--rm', '-e', `REPO=${build.repo}`];
|
const params = ['run', '--rm', '-e', `REPO=${build.repo}`];
|
||||||
|
if (build.dependencies) {
|
||||||
|
params.push('-e', `DEP=${build.dependencies}`);
|
||||||
|
}
|
||||||
if (build.commit) {
|
if (build.commit) {
|
||||||
// TODO: implement COMMIT
|
|
||||||
params.push('-e', `COMMIT=${build.commit}`);
|
params.push('-e', `COMMIT=${build.commit}`);
|
||||||
}
|
}
|
||||||
|
if (build.patch) {
|
||||||
|
params.push('-e', `PATCH=${build.patch}`);
|
||||||
|
}
|
||||||
params.push('--name', getContainerName(build.id));
|
params.push('--name', getContainerName(build.id));
|
||||||
params.push(docker_images[build.distro]);
|
params.push(docker_images[build.distro]);
|
||||||
return params;
|
return params;
|
||||||
|
@ -233,7 +233,6 @@ class DB {
|
|||||||
|
|
||||||
public async dequeue(): Promise<Build> {
|
public async dequeue(): Promise<Build> {
|
||||||
return await this.build.findOne({
|
return await this.build.findOne({
|
||||||
attributes: SELECT,
|
|
||||||
order: [['id', 'ASC']],
|
order: [['id', 'ASC']],
|
||||||
where: {
|
where: {
|
||||||
status: 'queued'
|
status: 'queued'
|
||||||
|
@ -145,6 +145,15 @@ class Web {
|
|||||||
res.set('Content-Type', 'text/plain').send(log);
|
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) => {
|
app.get('/healthcheck', (_, res) => {
|
||||||
res.send('Healthy');
|
res.send('Healthy');
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<footer>
|
<footer>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Developed by Cory Sanin</li>
|
<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>
|
</ul>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
Loading…
x
Reference in New Issue
Block a user