Files
chore/Jenkinsfile
2025-12-10 10:30:38 -05:00

42 lines
1.1 KiB
Groovy

pipeline {
agent any
environment {
// Tag images with the build number so they are unique
FRONTEND_IMAGE = "chore-app-backend:${env.BUILD_ID}"
BACKEND_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}'"
}
}
}
}