Adding Jenkins
This commit is contained in:
42
Jenkinsfile
vendored
Normal file
42
Jenkinsfile
vendored
Normal 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}'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user