Compare commits

..

10 Commits

Author SHA1 Message Date
1fea301ecf move to gitea
Some checks failed
App Image CI / Build app image (push) Failing after -18s
2025-04-29 20:56:09 -05:00
9722c4f992 use build package 2025-03-18 21:47:15 -05:00
96b9d3210c back to development: 0.1.4 2025-01-15 22:02:55 -05:00
14f0d494be 0.1.3: visual fix 2025-01-15 21:56:22 -05:00
7d07873536 0.1.2: visual improvements 2025-01-15 21:32:07 -05:00
69868d0f7c fix example docker-compose.yml 2025-01-14 20:31:27 -05:00
e1230b3fde Change workdir to archery 2025-01-14 20:30:06 -05:00
c83b7535c1 Read db password from env 2025-01-14 20:22:59 -05:00
4a3ce70751 Include some barebones documentation 2025-01-14 20:22:44 -05:00
97440f1352 prepare 0.1.0 release 2025-01-14 20:04:52 -05:00
18 changed files with 157 additions and 291 deletions

View File

@ -17,8 +17,6 @@ jobs:
runs-on: ubuntu-latest
env:
DH_REGISTRY: docker.io
GH_REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REPOSITORY: ${{ github.event.repository.name }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
permissions:
@ -42,60 +40,24 @@ jobs:
registry: ${{ env.DH_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for release Docker image
if: startsWith(github.ref, 'refs/tags/v')
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.REPOSITORY }}
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Extract metadata for develop Docker image
if: "!startsWith(github.ref, 'refs/tags/v')"
id: meta-develop
uses: docker/metadata-action@v5
with:
images: |
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push release Docker image
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6
with:
target: deploy
push: true
push: startsWith(github.ref, 'refs/tags/v')
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
- name: Build and push develop Docker image
if: "!startsWith(github.ref, 'refs/tags/v')"
uses: docker/build-push-action@v6
with:
target: deploy
push: true
tags: ${{ steps.meta-develop.outputs.tags }}
labels: ${{ steps.meta-develop.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha,scope=${{ github.workflow }}
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

View File

@ -39,22 +39,22 @@ jobs:
run: echo "DEPLOY=true" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
uses: https://github.com/actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
uses: https://github.com/docker/setup-buildx-action@v3
with:
install: true
- name: Log in to the Docker Hub
uses: docker/login-action@v3
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v6
uses: https://github.com/docker/build-push-action@v6
with:
push: ${{ env.DEPLOY }}
pull: true

View File

@ -5,13 +5,13 @@ WORKDIR /build
COPY ./package*json ./
RUN npm ci
COPY . .
RUN node --experimental-strip-types build.ts && \
RUN npm run build && \
npm exec tsc && \
npm ci --only=production --omit=dev
FROM base as deploy
FROM base AS deploy
WORKDIR /srv/abt
WORKDIR /srv/archery
RUN apk add --no-cache docker-cli
COPY --from=build-env /build .

171
build.ts
View File

@ -1,171 +0,0 @@
import fs from 'fs';
import path from 'path';
import child_process from 'child_process';
import uglifyjs from "uglify-js";
import * as sass from 'sass';
import * as csso from 'csso';
const spawn = child_process.spawn;
const fsp = fs.promises;
const STYLESDIR = 'styles';
const SCRIPTSDIR = 'scripts';
const IMAGESDIR = path.join('assets', 'images');
const STYLEOUTDIR = process.env.STYLEOUTDIR || path.join(import.meta.dirname, 'assets', 'css');
const SCRIPTSOUTDIR = process.env.SCRIPTSOUTDIR || path.join(import.meta.dirname, 'assets', 'js');
const IMAGESOUTDIR = process.env.IMAGESOUTDIR || path.join(import.meta.dirname, 'assets', 'webp');
const STYLEOUTFILE = process.env.STYLEOUTFILE || 'styles.css';
const SQUASH = new RegExp('^[0-9]+-');
async function emptyDir(dir: string) {
await Promise.all((await fsp.readdir(dir, { withFileTypes: true })).map(f => path.join(dir, f.name)).map(p => fsp.rm(p, {
recursive: true,
force: true
})));
}
async function mkdir(dir: string | string[]) {
if (typeof dir === 'string') {
await fsp.mkdir(dir, { recursive: true });
}
else {
await Promise.all(dir.map(mkdir));
}
}
// Process styles
async function styles() {
await mkdir([STYLEOUTDIR, STYLESDIR]);
await emptyDir(STYLEOUTDIR);
let styles: string[] = [];
let files = await fsp.readdir(STYLESDIR);
await Promise.all(files.map(f => new Promise(async (res, reject) => {
let p = path.join(STYLESDIR, f);
console.log(`Processing style ${p}`);
let style = sass.compile(p).css;
if (f.charAt(0) !== '_') {
if (SQUASH.test(f)) {
styles.push(style);
}
else {
let o = path.join(STYLEOUTDIR, f.substring(0, f.lastIndexOf('.')) + '.css');
await fsp.writeFile(o, csso.minify(style).css);
console.log(`Wrote ${o}`);
}
}
res(0);
})));
let out = csso.minify(styles.join('\n')).css;
let outpath = path.join(STYLEOUTDIR, STYLEOUTFILE);
await fsp.writeFile(outpath, out);
console.log(`Wrote ${outpath}`);
}
// Process scripts
async function scripts() {
await mkdir([SCRIPTSOUTDIR, SCRIPTSDIR]);
await emptyDir(SCRIPTSOUTDIR);
let files = await fsp.readdir(SCRIPTSDIR);
await Promise.all(files.map(f => new Promise(async (res, reject) => {
let p = path.join(SCRIPTSDIR, f);
let o = path.join(SCRIPTSOUTDIR, f);
console.log(`Processing script ${p}`);
try {
await fsp.writeFile(o, uglifyjs.minify((await fsp.readFile(p)).toString()).code);
console.log(`Wrote ${o}`);
}
catch (ex) {
console.log(`error writing ${o}: ${ex}`);
}
res(0);
})));
}
// Process images
async function images(dir = '') {
let p = path.join(IMAGESDIR, dir);
await mkdir(p);
if (dir.length === 0) {
await mkdir(IMAGESOUTDIR)
await emptyDir(IMAGESOUTDIR);
}
let files = await fsp.readdir(p, {
withFileTypes: true
});
if (files.length) {
await Promise.all(files.map(f => new Promise(async (res, reject) => {
if (f.isFile()) {
let outDir = path.join(IMAGESOUTDIR, dir);
let infile = path.join(p, f.name);
let outfile = path.join(outDir, f.name.substring(0, f.name.lastIndexOf('.')) + '.webp');
await mkdir(outDir);
console.log(`Processing image ${infile}`)
let process = spawn('cwebp', ['-mt', '-q', '50', infile, '-o', outfile]);
let timeout = setTimeout(() => {
reject('Timed out');
process.kill();
}, 30000);
process.on('exit', async (code) => {
clearTimeout(timeout);
if (code === 0) {
console.log(`Wrote ${outfile}`);
res(null);
}
else {
reject(code);
}
});
}
else if (f.isDirectory()) {
images(path.join(dir, f.name)).then(res).catch(reject);
}
})));
}
}
function isAbortError(err: unknown): boolean {
return typeof err === 'object' && err !== null && 'name' in err && err.name === 'AbortError';
}
(async function () {
await Promise.all([styles(), scripts(), images()]);
if (process.argv.indexOf('--watch') >= 0) {
console.log('watching for changes...');
(async () => {
try {
const watcher = fsp.watch(STYLESDIR);
for await (const _ of watcher)
await styles();
} catch (err) {
if (isAbortError(err))
return;
throw err;
}
})();
(async () => {
try {
const watcher = fsp.watch(SCRIPTSDIR);
for await (const _ of watcher)
await scripts();
} catch (err) {
if (isAbortError(err))
return;
throw err;
}
})();
(async () => {
try {
const watcher = fsp.watch(IMAGESDIR, {
recursive: true // no Linux ☹️
});
for await (const _ of watcher)
await images();
} catch (err) {
if (isAbortError(err))
return;
throw err;
}
})();
}
})();

View File

@ -1 +1,9 @@
{}
{
"db": {
"host": "postgres",
"password": "correcthorse"
},
"web": {
"port": 8080
}
}

View File

@ -7,8 +7,10 @@ services:
context: ./
dockerfile: Dockerfile
volumes:
- ./config:/srv/abt/config
- ./config:/srv/archery/config
- /var/run/docker.sock:/var/run/docker.sock
environment:
PASSWORD: ${POSTGRES_PASSWORD}
restart: "no"
ports:
- 8080:8080

77
package-lock.json generated
View File

@ -1,21 +1,21 @@
{
"name": "archery",
"version": "0.0.2",
"version": "0.1.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "archery",
"version": "0.0.2",
"version": "0.1.6",
"license": "MIT",
"dependencies": {
"body-parser": "^1.20.3",
"ejs": "3.1.10",
"express": "^4.21.2",
"express-ws": "^5.0.2",
"pg": "^8.13.1",
"pg": "^8.15.6",
"pg-hstore": "^2.3.4",
"sequelize": "^6.37.5"
"sequelize": "^6.37.7"
},
"devDependencies": {
"@types/csso": "5.0.4",
@ -23,9 +23,7 @@
"@types/express-ws": "3.0.5",
"@types/node": "^22.10.5",
"@types/uglify-js": "3.17.5",
"csso": "5.0.5",
"sass": "1.83.1",
"uglify-js": "3.19.3"
"forking-build-shit": "0.0.2"
},
"peerDependencies": {
"typescript": "5.7.3"
@ -1031,6 +1029,21 @@
"node": ">= 0.8"
}
},
"node_modules/forking-build-shit": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/forking-build-shit/-/forking-build-shit-0.0.2.tgz",
"integrity": "sha512-1qpXIK3nX8ZPTbwojsqxjTp5qDITX24MkKaX/8p6mMkIAQiVul1nhdYCAFLpnpnLon87Ru1exlJKhkvIKT7b+A==",
"dev": true,
"license": "MIT",
"dependencies": {
"csso": "5.0.5",
"sass": "1.86.0",
"uglify-js": "3.19.3"
},
"bin": {
"build-shit": "bin/build-shit.js"
}
},
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@ -1446,14 +1459,14 @@
"license": "MIT"
},
"node_modules/pg": {
"version": "8.13.1",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.13.1.tgz",
"integrity": "sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ==",
"version": "8.15.6",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.15.6.tgz",
"integrity": "sha512-yvao7YI3GdmmrslNVsZgx9PfntfWrnXwtR+K/DjI0I/sTKif4Z623um+sjVZ1hk5670B+ODjvHDAckKdjmPTsg==",
"license": "MIT",
"dependencies": {
"pg-connection-string": "^2.7.0",
"pg-pool": "^3.7.0",
"pg-protocol": "^1.7.0",
"pg-connection-string": "^2.8.5",
"pg-pool": "^3.9.6",
"pg-protocol": "^1.9.5",
"pg-types": "^2.1.0",
"pgpass": "1.x"
},
@ -1461,7 +1474,7 @@
"node": ">= 8.0.0"
},
"optionalDependencies": {
"pg-cloudflare": "^1.1.1"
"pg-cloudflare": "^1.2.5"
},
"peerDependencies": {
"pg-native": ">=3.0.1"
@ -1473,16 +1486,16 @@
}
},
"node_modules/pg-cloudflare": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz",
"integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==",
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.5.tgz",
"integrity": "sha512-OOX22Vt0vOSRrdoUPKJ8Wi2OpE/o/h9T8X1s4qSkCedbNah9ei2W2765be8iMVxQUsvgT7zIAT2eIa9fs5+vtg==",
"license": "MIT",
"optional": true
},
"node_modules/pg-connection-string": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz",
"integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==",
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.8.5.tgz",
"integrity": "sha512-Ni8FuZ8yAF+sWZzojvtLE2b03cqjO5jNULcHFfM9ZZ0/JXrgom5pBREbtnAw7oxsxJqHw9Nz/XWORUEL3/IFow==",
"license": "MIT"
},
"node_modules/pg-hstore": {
@ -1507,18 +1520,18 @@
}
},
"node_modules/pg-pool": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.7.0.tgz",
"integrity": "sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g==",
"version": "3.9.6",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.9.6.tgz",
"integrity": "sha512-rFen0G7adh1YmgvrmE5IPIqbb+IgEzENUm+tzm6MLLDSlPRoZVhzU1WdML9PV2W5GOdRA9qBKURlbt1OsXOsPw==",
"license": "MIT",
"peerDependencies": {
"pg": ">=8.0"
}
},
"node_modules/pg-protocol": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz",
"integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==",
"version": "1.9.5",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.9.5.tgz",
"integrity": "sha512-DYTWtWpfd5FOro3UnAfwvhD8jh59r2ig8bPtc9H8Ds7MscE/9NYruUQWFAOuraRl29jwcT2kyMFQ3MxeaVjUhg==",
"license": "MIT"
},
"node_modules/pg-types": {
@ -1698,9 +1711,9 @@
"license": "MIT"
},
"node_modules/sass": {
"version": "1.83.1",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.83.1.tgz",
"integrity": "sha512-EVJbDaEs4Rr3F0glJzFSOvtg2/oy2V/YrGFPqPY24UqcLDWcI9ZY5sN+qyO3c/QCZwzgfirvhXvINiJCE/OLcA==",
"version": "1.86.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.86.0.tgz",
"integrity": "sha512-zV8vGUld/+mP4KbMLJMX7TyGCuUp7hnkOScgCMsWuHtns8CWBoz+vmEhoGMXsaJrbUP8gj+F1dLvVe79sK8UdA==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -1770,9 +1783,9 @@
"license": "MIT"
},
"node_modules/sequelize": {
"version": "6.37.5",
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.5.tgz",
"integrity": "sha512-10WA4poUb3XWnUROThqL2Apq9C2NhyV1xHPMZuybNMCucDsbbFuKg51jhmyvvAUyUqCiimwTZamc3AHhMoBr2Q==",
"version": "6.37.7",
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.7.tgz",
"integrity": "sha512-mCnh83zuz7kQxxJirtFD7q6Huy6liPanI67BSlbzSYgVNl5eXVdE2CN1FuAeZwG1SNpGsNRCV+bJAVVnykZAFA==",
"funding": [
{
"type": "opencollective",

View File

@ -1,6 +1,6 @@
{
"name": "archery",
"version": "0.0.2",
"version": "0.1.6",
"description": "Build Arch packages through a web interface",
"keywords": [
"docker",
@ -24,9 +24,9 @@
"ejs": "3.1.10",
"express": "^4.21.2",
"express-ws": "^5.0.2",
"pg": "^8.13.1",
"pg": "^8.15.6",
"pg-hstore": "^2.3.4",
"sequelize": "^6.37.5"
"sequelize": "^6.37.7"
},
"devDependencies": {
"@types/csso": "5.0.4",
@ -34,11 +34,13 @@
"@types/express-ws": "3.0.5",
"@types/node": "^22.10.5",
"@types/uglify-js": "3.17.5",
"csso": "5.0.5",
"sass": "1.83.1",
"uglify-js": "3.19.3"
"forking-build-shit": "0.0.2"
},
"peerDependencies": {
"typescript": "5.7.3"
},
"scripts": {
"build": "npx build-shit",
"watch": "npx build-shit --watch"
}
}

6
readme.md Normal file
View File

@ -0,0 +1,6 @@
# Archery
## Build system for pacman
Quickly trigger build jobs on a remote system (perhaps one with more RAM?) for debugging packaging issues. Switch between Artix and Arch to compare builds. Enable testing or staging repos in a single click.
Consult [docker-compose.yml](docker-compose.yml) and [config.example.json](config/config.example.json) to get an understanding of how to deploy Archery.

View File

@ -13,12 +13,14 @@ document.addEventListener('DOMContentLoaded', function () {
/**
* Add log line to the DOM
* @param {string} str
* @param {string[]} str
*/
function appendLine(str, e = false) {
const p = document.createElement('p');
p.appendChild(document.createTextNode(str));
logContainer.appendChild(p);
function appendLines(str, e = false) {
str.forEach(line => {
const p = document.createElement('p');
p.appendChild(document.createTextNode(line));
logContainer.appendChild(p);
});
}
/**
@ -30,6 +32,14 @@ document.addEventListener('DOMContentLoaded', function () {
}
}
/**
* Split string by newline char
* @param {string} str
*/
function splitLines(str) {
return str.split('\n').map(line => line.substring(line.lastIndexOf('\r') + 1));
}
/**
* Establish websocket connection
*/
@ -41,15 +51,14 @@ document.addEventListener('DOMContentLoaded', function () {
var ws = new WebSocket(new_uri);
ws.onmessage = function (message) {
console.log('Got message: ', message);
const buildEvent = JSON.parse(message.data);
if (buildEvent.type === 'finish') {
ws.close();
buildStatusTxt.replaceChild(document.createTextNode(buildEvent.message), buildStatusTxt.firstChild);
}
else {
appendLine(buildEvent.message, buildEvent.type === 'err');
appendLines(splitLines(buildEvent.message), buildEvent.type === 'err');
scrollToBottom();
}
}

View File

@ -48,7 +48,7 @@ class DB {
private sequelize: Sequelize;
constructor(config: DBConfig = {}) {
this.sequelize = new Sequelize(config.db || 'archery', config.user || 'archery', config.password || '', {
this.sequelize = new Sequelize(config.db || 'archery', config.user || 'archery', process.env.PASSWORD || config.password || '', {
host: config.host || 'localhost',
port: config.port || 5432,
dialect: 'postgres'
@ -269,4 +269,4 @@ class DB {
export default DB;
export { DB };
export type { DBConfig, Status, Build };
export type { DBConfig, Status, Build, LogChunk };

View File

@ -4,7 +4,7 @@ import type { Express } from "express";
import express from 'express';
import expressWs from "express-ws";
import bodyParser from "body-parser";
import type { DB } from "./DB.ts";
import type { DB, LogChunk } from "./DB.ts";
import type { BuildController, BuildEvent } from "./BuildController.ts";
interface WebConfig {
@ -29,6 +29,10 @@ function timeElapsed(date1: Date, date2: Date) {
return `${hours}:${minutes}:${seconds}`;
}
function splitLines(lines: LogChunk[]) {
return lines.map(logChunk => logChunk.chunk.split('\n')).flat().map(line => line.substring(line.lastIndexOf('\r') + 1));
}
class Web {
private _webserver: http.Server | null = null;
private db: DB;
@ -106,7 +110,7 @@ class Web {
res.sendStatus(404);
return;
}
const log = (await this.db.getLog(build.id)).map(logChunk => logChunk.chunk.split('\n')).flat();
const log = splitLines(await this.db.getLog(build.id));
res.render('build', {
page: {

View File

@ -11,7 +11,7 @@ interface compositeConfig {
db?: DBConfig
}
const config: compositeConfig = JSON.parse(await fs.promises.readFile(process.env.config || path.join('config', 'config.json'), 'utf-8'));
const config: compositeConfig = JSON.parse(await fs.promises.readFile(process.env.config || process.env.CONFIG || path.join('config', 'config.json'), 'utf-8'));
const web = new Web(config.web);
const buildController = new BuildController();

View File

@ -54,6 +54,7 @@ table {
background-color: #2a2a2a;
border-collapse: collapse;
width: 100%;
min-width: 42em;
}
td,
@ -120,7 +121,7 @@ input[type="submit"] {
.sidebar {
background: var(--primary);
width: 16em;
width: 13rem;
height: 100%;
position: fixed;
top: 0;
@ -183,7 +184,7 @@ input[type="submit"] {
}
.content {
margin-left: 16em;
margin-left: 13rem;
padding: 1em;
&.no-padding {
@ -200,6 +201,8 @@ input[type="submit"] {
display: grid;
grid-template-columns: auto 1fr;
gap: .65em;
word-break: keep-all;
white-space: nowrap;
.span-2 {
grid-column: span 2;
@ -207,12 +210,13 @@ input[type="submit"] {
}
.logs {
width: fit-content;
min-width: 100%;
font-family: 'Courier New', monospace;
font-size: 0.9em;
border-left: #d96a14 .2em solid;
background: #2a2a2a;
margin-top: 1em;
overflow-x: auto;
overflow-wrap: anywhere;
p {
padding: .1em .5em;
@ -253,10 +257,10 @@ input[type="submit"] {
right: 1.3em;
bottom: 1.6em;
padding: 1em;
background-color: rgba(15,15,15,.8);
background-color: rgba(15, 15, 15, .8);
cursor: pointer;
input {
cursor: inherit;
}
}
}

View File

@ -15,4 +15,32 @@
.content {
margin-left: 0;
}
.logs {
font-size: 0.75em;
}
}
@media screen and (max-width:28rem) {
body {
font-size: 13pt;
}
.grid-2col {
grid-template-columns: 1fr;
.span-2 {
grid-column: initial;
}
&> :nth-last-child(n+2):nth-child(odd) {
font-weight: bold;
font-size: 1.1em;
&::after {
content: ":";
}
}
}
}

View File

@ -10,13 +10,15 @@
<div class="content">
<h1>Build #<%= build.id %></h1>
<h2 id="buildStatus"><%= build.status %></h2>
<div class="grid-2col">
<label>Repo</label> <span><%= build.repo %></span>
<label>Commit</label> <span><% if (build.commit) { %><%= build.commit %><% } else { %>latest<% } %></span>
<label>Patch</label> <span><% if (build.patch) { %><a href="/build/<%= build.id %>/patch">patch file</a><% } else { %>none<% } %></span>
<label>Distro</label> <span><%= build.distro %></span>
<label>Dependencies</label> <span><%= build.dependencies %></span>
<label>Start time</label> <span class="to-local-time"><%= build.startTime %></span>
<div class="overflow-x">
<div class="grid-2col">
<label>Repo</label> <span><%= build.repo %></span>
<label>Commit</label> <span><% if (build.commit) { %><%= build.commit %><% } else { %>latest<% } %></span>
<label>Patch</label> <span><% if (build.patch) { %><a href="/build/<%= build.id %>/patch">patch file</a><% } else { %>none<% } %></span>
<label>Distro</label> <span><%= build.distro %></span>
<label>Dependencies</label> <span><%= build.dependencies %></span>
<label>Start time</label> <span class="to-local-time"><%= build.startTime %></span>
</div>
</div>
<% if (!ended) { %>
<div>
@ -24,11 +26,7 @@
</div>
<% } %>
<p><a href="/build/<%= build.id %>/logs">Full logs</a></p>
<div class="logs" id="logs">
<% (log || []).forEach(line => { %>
<p><%= line %></p>
<% }) %>
</div>
<pre class="overflow-x"><div class="logs" id="logs"><% (log || []).forEach(line => { %><p><%= line %></p><% }) %></div></pre>
<% if (!ended) { %>
<label id="followCheckmarkContainer" title="Follow logs">
@ -39,7 +37,7 @@
<%- include("footer", locals) %>
<script src="/assets/js/timezone.js?v1" nonce="<%= cspNonce %>"></script>
<% if (!ended) { %>
<script src="/assets/js/build.js?v1" nonce="<%= cspNonce %>"></script>
<script src="/assets/js/build.js?v2" nonce="<%= cspNonce %>"></script>
<% } %>
</body>
</html>

View File

@ -1,8 +1,9 @@
<div class="content footer">
<footer>
<ul>
<li><a href="/">Home</a></li>
<li>Developed by Cory Sanin</li>
<li><a href="https://github.com/CorySanin/archery">Source</a></li>
<li><a href="https://git.sanin.dev/corysanin/archery">Source</a></li>
</ul>
</footer>
</div>

View File

@ -14,7 +14,7 @@
<link rel="canonical" href="<%= page.canonical%>"/>
<% } %>
<link rel="shortcut icon" href="/assets/svg/favicon.svg">
<link rel="stylesheet" href="/assets/css/styles.css?v1">
<link rel="stylesheet" href="/assets/css/styles.css?v3">
<script nonce="<%= cspNonce %>">
document.addEventListener("DOMContentLoaded", function() {
document.body.classList.remove('preload');