Author SHA1 Message Date
nageshwaran_manikumar 99fb0ad1fe ci: automate Python tests and clean release artifacts refs #15 2026-11-30 20:56:51 -05:00
nageshwaran_manikumar 6cee97faa6 test: verify missing database status refs #15
startup-product-gitea-ci/pipeline/head This commit looks good
2026-11-30 20:17:04 -05:00
nageshwaran_manikumar 570f024fa2 ci: add final project Jenkins pipeline refs #15
startup-product-gitea-ci/pipeline/head This commit looks good
2026-11-30 19:49:14 -05:00
shiv 6f7af27d04 Merge pull request 'docs: restore SRE chapter and integrate secure delivery chapter 6' (#13) from feature/chapter6-secure-delivery into main
startup-product-gitea-ci/pipeline/head This commit looks good
Build DevOps IT Manual / Compile LaTeX PDF (push) Canceled after 0s
Reviewed-on: #13
Reviewed-by: shiv <Shivpatel2002@gmail.com>
2026-11-26 09:14:35 +00:00
shiv 73a66b87dd Merge pull request 'Chapter 6: Secure Delivery and Rollback' (#12) from feature/chapter6-secure-delivery into main
startup-product-gitea-ci/pipeline/head This commit looks good
Build DevOps IT Manual / Compile LaTeX PDF (push) Successful in 1m17s
Reviewed-on: #12
Reviewed-by: shiv <Shivpatel2002@gmail.com>
2026-11-14 02:39:02 +00:00
2 changed files with 150 additions and 0 deletions
+143
View File
@@ -0,0 +1,143 @@
pipeline {
agent any
options {
disableConcurrentBuilds()
skipDefaultCheckout(true)
timeout(time: 10, unit: 'MINUTES')
buildDiscarder(logRotator(
numToKeepStr: '5',
artifactNumToKeepStr: '3'
))
}
stages {
stage('Checkout') {
steps {
checkout scm
sh 'git log -1 --oneline'
}
}
stage('Verify Build Tools') {
steps {
sh '''
node --version
npm --version
python3 --version
'''
}
}
stage('JavaScript Validation') {
steps {
dir('app') {
sh 'npm run check'
}
}
}
stage('JavaScript Unit Tests') {
steps {
dir('app') {
sh 'npm test'
}
}
}
stage('Python Validation') {
steps {
dir('pricing-service') {
sh '''
python3 -m py_compile app.py test_app.py
echo "Python syntax validation PASSED"
'''
}
}
}
stage('Python Unit Tests') {
steps {
dir('pricing-service') {
sh '''
set -eu
export PYTHONPATH=/var/jenkins_home/final-project-python-deps
export PYTHONDONTWRITEBYTECODE=1
python3 -m unittest -v test_app
echo "Python unit tests PASSED"
'''
}
}
}
stage('Versioned Package') {
steps {
sh '''
set -eu
VERSION="1.0.${BUILD_NUMBER}"
rm -rf dist
mkdir -p dist
printf '%s\\n' "$VERSION" > dist/VERSION
git rev-parse HEAD > dist/COMMIT
python3 -m zipfile -c \
"dist/startup-product-${VERSION}.zip" \
app/package.json \
app/src \
app/test \
pricing-service/app.py \
pricing-service/test_app.py \
pricing-service/requirements.txt \
pricing-service/Dockerfile \
dist/VERSION \
dist/COMMIT
echo "Package version: $VERSION"
ls -lh dist/
'''
}
}
stage('Verify Package Integrity') {
steps {
sh '''
set -eu
python3 -m zipfile -t \
"dist/startup-product-1.0.${BUILD_NUMBER}.zip"
echo "Package integrity PASSED"
'''
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts(
artifacts: 'dist/*',
fingerprint: true,
onlyIfSuccessful: true
)
}
}
}
post {
success {
echo 'FINAL PROJECT BASELINE BUILD PASSED'
}
failure {
echo 'FINAL PROJECT BASELINE BUILD FAILED'
}
always {
echo "Build number: ${env.BUILD_NUMBER}"
echo "Build URL: ${env.BUILD_URL}"
}
}
}
+7
View File
@@ -15,3 +15,10 @@ test("reports unhealthy when database is disconnected", () => {
database: "disconnected" database: "disconnected"
}); });
}); });
test("reports unhealthy when database status is missing", () => {
assert.deepEqual(getHealthStatus(), {
status: "unhealthy",
database: "disconnected"
});
});