Adding Jenkins

This commit is contained in:
2025-12-10 10:04:56 -05:00
parent b101ca9109
commit 9b3ff7d143

42
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,42 @@
pipeline {
agent any
environment {
// Tag images with the build number so they are unique
BACKEND_IMAGE = "chore-app-backend:${env.BUILD_ID}"
FLASK_IMAGE = "chore-app-frontend:${env.BUILD_ID}"
}
stages {
stage('Checkout') {
steps {
// Pulls code from your configured Git repo
checkout scm
}
}
stage('Build Frontend (Vue) App') {
steps {
dir('web/vue-app') {
sh 'docker build -t ${FRONTEND_IMAGE} .'
}
}
}
stage('Build Backend (Flask) App') {
steps {
dir('.') {
sh 'docker build -t ${BACKEND_IMAGE} .'
}
}
}
stage('Cleanup') {
steps {
// Optional: Stop old containers and run the new ones
// Note: In production, you would push to a registry (DockerHub) instead
sh "echo 'Build Complete. Images ready: ${FRONTEND_IMAGE} and ${BACKEND_IMAGE}'"
}
}
}
}