Compare commits

..
Author SHA1 Message Date
natalie 9d9470b8cd Fix failing quiz test for issue #5
seat-back-trivia/pipeline/pr-main This commit looks good
seat-back-trivia/pipeline/head This commit looks good
2026-10-23 18:42:49 +00:00
natalie 590a50d959 Demonstrate Jenkins failure for issue #5
seat-back-trivia/pipeline/pr-main There was a failure building this commit
2026-10-23 17:58:14 +00:00
natalie db330b3fad Add npm lockfile for reproducible CI installs
seat-back-trivia/pipeline/head This commit looks good
2026-10-23 13:48:59 +00:00
natalie 1073d8dfde Add automated test for quiz question 2026-10-23 13:29:28 +00:00
natalie e14262db4d Add minimal WebSocket quiz server 2026-10-23 13:24:49 +00:00
natalie b2c00cd23d Add Node.js project configuration for CI 2026-10-23 13:19:20 +00:00
natalie f323549ae7 Add Jenkins CI pipeline for issue #5 2026-10-23 13:11:58 +00:00
natalie 60de2961b2 Merge pull request 'Add Node.js .gitignore' (#7) from issue-3-gitignore into main
Reviewed-on: #7
Reviewed-by: natalie <naragon@stevens.edu>
2026-09-30 20:40:45 +00:00
natalie 0780e1e794 Merge pull request 'Add Gitea and Caddy deployment configuration' (#6) from issue-1-deploy-config into main
Reviewed-on: #6
Reviewed-by: natalie <naragon@stevens.edu>
2026-09-30 20:24:59 +00:00
Cedric Pollefeys 930fefb32d Add Gitea and Caddy deployment configuration (#1) 2026-09-29 21:38:44 -04:00
7 changed files with 158 additions and 0 deletions
Vendored
+30
View File
@@ -0,0 +1,30 @@
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Verify Node.js') {
steps {
sh 'node --version'
sh 'npm --version'
}
}
stage('Install Dependencies') {
steps {
sh 'npm ci'
}
}
stage('Test') {
steps {
sh 'npm test'
}
}
}
}
+5
View File
@@ -0,0 +1,5 @@
# Caddy obtains and renews the Let's Encrypt certificate for this hostname
# and redirects HTTP to HTTPS automatically. TLS terminates here.
git.pollefeys.dev {
reverse_proxy gitea:3000
}
+49
View File
@@ -0,0 +1,49 @@
# Seat-Back Trivia startup work hub: Gitea behind Caddy on the ssw-590 droplet.
# Only Caddy publishes host ports. Gitea is reachable only on the private
# gitea-net network, and its SQLite database lives in the gitea-data volume.
name: gitea
services:
caddy:
image: caddy:2.11.4
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy-data:/data
- caddy-config:/config
networks:
- gitea-net
depends_on:
- gitea
gitea:
image: docker.gitea.com/gitea:1.27.3
restart: unless-stopped
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__server__DOMAIN=git.pollefeys.dev
- GITEA__server__ROOT_URL=https://git.pollefeys.dev/
- GITEA__server__HTTP_PORT=3000
- GITEA__server__DISABLE_SSH=true
- GITEA__database__DB_TYPE=sqlite3
- GITEA__database__PATH=/data/gitea/gitea.db
- GITEA__security__INSTALL_LOCK=true
- GITEA__service__DISABLE_REGISTRATION=true
volumes:
- gitea-data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- gitea-net
networks:
gitea-net:
volumes:
gitea-data:
caddy-data:
caddy-config:
+36
View File
@@ -0,0 +1,36 @@
{
"name": "seat-back-trivia",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "seat-back-trivia",
"version": "1.0.0",
"dependencies": {
"ws": "8.18.3"
}
},
"node_modules/ws": {
"version": "8.18.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": ">=5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
}
}
}
+12
View File
@@ -0,0 +1,12 @@
{
"name": "seat-back-trivia",
"version": "1.0.0",
"private": true,
"description": "Minimal WebSocket quiz server for SeatBack Trivia",
"scripts": {
"test": "node --test"
},
"dependencies": {
"ws": "8.18.3"
}
}
+15
View File
@@ -0,0 +1,15 @@
const WebSocket = require('ws');
const PORT = process.env.PORT || 8080;
const wss = new WebSocket.Server({ port: PORT });
const question = {
question: 'What is the capital of France?',
answer: 'Paris'
};
wss.on('connection', (ws) => {
ws.send(JSON.stringify(question));
});
console.log(`SeatBack Trivia WebSocket server listening on port ${PORT}`);
+11
View File
@@ -0,0 +1,11 @@
const test = require('node:test');
const assert = require('node:assert/strict');
test('sample trivia question has the expected answer', () => {
const question = {
question: 'What is the capital of France?',
answer: 'Paris'
};
assert.equal(question.answer, 'Paris');
});