5 Commits
Author SHA1 Message Date
nageshwaran_manikumar b2cdc5cad4 Merge pull request 'Add Jenkins CI pipeline and automated Node.js tests' (#8) from feature/jenkins-ci into main
startup-product-gitea-ci/pipeline/head This commit looks good
Build DevOps IT Manual / Compile LaTeX PDF (push) Successful in 34s
Reviewed-on: #8
Reviewed-by: shiv <Shivpatel2002@gmail.com>
2026-10-23 07:14:28 +00:00
nageshwaran_manikumar e00142ae09 Fix failing health check test and restore CI
startup-product-gitea-ci/pipeline/pr-main This commit looks good
2026-10-23 02:55:58 -04:00
nageshwaran_manikumar e1d900755c Demonstrate Jenkins CI failure with intentional test mismatch
startup-product-gitea-ci/pipeline/pr-main There was a failure building this commit
2026-10-23 02:41:40 -04:00
nageshwaran_manikumar cb7a62a2a5 Test automatic Jenkins webhook trigger
startup-product-gitea-ci/pipeline/head This commit looks good
startup-product-gitea-ci/pipeline/pr-main This commit looks good
2026-10-22 22:38:43 -04:00
nageshwaran_manikumar 0b5c0a8ab1 Add Jenkins CI pipeline and Node.js automated tests
startup-product-gitea-ci/pipeline/head This commit looks good
2026-10-22 20:48:38 -04:00
5 changed files with 84 additions and 0 deletions
Vendored
+49
View File
@@ -0,0 +1,49 @@
pipeline {
agent any
options {
disableConcurrentBuilds()
timeout(time: 5, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Verify Node.js') {
steps {
sh 'node --version'
sh 'npm --version'
}
}
stage('Syntax Check') {
steps {
dir('app') {
sh 'npm run check'
}
}
}
stage('Automated Tests') {
steps {
dir('app') {
sh 'npm test'
}
}
}
}
post {
success {
echo 'CI PASSED: All checks completed successfully.'
}
failure {
echo 'CI FAILED: Review the Jenkins console output.'
}
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"name": "startup-product",
"version": "1.0.0",
"private": true,
"scripts": {
"test": "node --test",
"check": "node --check src/health.js"
}
}
+8
View File
@@ -0,0 +1,8 @@
function getHealthStatus(databaseConnected) {
return {
status: databaseConnected ? "healthy" : "unhealthy",
database: databaseConnected ? "connected" : "disconnected"
};
}
module.exports = { getHealthStatus };
+17
View File
@@ -0,0 +1,17 @@
const test = require("node:test");
const assert = require("node:assert/strict");
const { getHealthStatus } = require("../src/health");
test("reports healthy when database is connected", () => {
assert.deepEqual(getHealthStatus(true), {
status: "healthy",
database: "connected"
});
});
test("reports unhealthy when database is disconnected", () => {
assert.deepEqual(getHealthStatus(false), {
status: "unhealthy",
database: "disconnected"
});
});
+1
View File
@@ -0,0 +1 @@
Jenkins webhook automatic build test