From 966084e31b89de043743ceca013636656ca7698c Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Wed, 18 Feb 2026 15:04:19 +0200 Subject: [PATCH] m --- proiect-nutritie/Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 proiect-nutritie/Jenkinsfile diff --git a/proiect-nutritie/Jenkinsfile b/proiect-nutritie/Jenkinsfile new file mode 100644 index 0000000..9f9f4bd --- /dev/null +++ b/proiect-nutritie/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + // Jenkins ia automat codul de pe branch-ul develop + checkout scm + } + } + + stage('Build Docker Image') { + steps { + // Mergem în folderul proiectului și facem build + dir('it_school/proiect-nutritie') { + sh 'docker build -t dieta-app-jenkins .' + } + } + } + + stage('Clean & Deploy') { + steps { + // Oprim ce rulează manual (pe portul 8085) și pornim versiunea Jenkins + sh ''' + docker stop test-dieta || true + docker rm test-dieta || true + docker run -d -p 8085:5000 --name test-dieta dieta-app-jenkins + ''' + } + } + } +} \ No newline at end of file