-
Notifications
You must be signed in to change notification settings - Fork 1
/
jenkinsfile
29 lines (27 loc) · 837 Bytes
/
jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pipeline {
agent any
stages {
stage('Checkout') {
steps {
// Check out your Git repository here
git branch: 'main', url: 'https://github.com/abdraheem98/URL-Shortner-app.git'
}
}
stage('Create Virtual Environment') {
steps {
sh 'python3 -m venv /var/lib/jenkins/workspace/Flask-app/venv'
}
}
stage('Install Python Dependencies') {
steps {
sh '/var/lib/jenkins/workspace/Flask-app/venv/bin/pip install -r requirements.txt'
}
}
stage('Run Flask App') {
steps {
// Run your Flask app using a Docker container
sh 'docker run -d -p 5000:5000 my-flask-app'
}
}
}
}