diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..119445e --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,21 @@ +pipeline { + agent { label any } + + stages { + stage('Stop and Remove Existing Container') { + steps { + sh ''' + docker stop fastapi_hello_time || true + docker rm fastapi_hello_time || true + docker-compose down || true + ''' + } + } + + stage('Build and Run Container') { + steps { + sh ''' + docker-compose up --build -d + ''' + } + }