-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
35 lines (34 loc) · 1.01 KB
/
Jenkinsfile
File metadata and controls
35 lines (34 loc) · 1.01 KB
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
30
31
32
33
34
35
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Starting build'
sh "sudo yum -y install python3"
sh "sudo pip3 install --upgrade pip"
sh "python3 -m venv venv"
sh "source venv/bin/activate"
sh "pip3 install -r requirements.txt"
}
}
stage('Test') {
steps {
echo 'Starting Testing'
sh ". ~/.bashrc; /var/lib/jenkins/.local/bin/pytest"
}
}
stage('Deploy') {
steps {
echo "Stopping any current running app"
sh "nohup kill \$(ps -ef | grep /src/app.py | grep -v grep | awk '{print \$2}') &"
echo 'Starting deployment'
sh "JENKINS_NODE_COOKIE=dontKillMe nohup python3 src/app.py &"
}
}
stage('Release') {
steps {
echo 'Starting Release'
}
}
}
}