diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..d1a7831 --- /dev/null +++ b/Jenkinsfile @@ -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}'" + } + } + } +} \ No newline at end of file