-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
39 lines (36 loc) · 1.18 KB
/
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
30
31
32
33
34
35
36
37
38
39
pipeline {
agent any
environment {
PYTHON_VERSION = '3.9'
}
parameters {
string(name: 'THRESHOLD', defaultValue: '85', description: 'Disk usage threshold')
string(name: 'LOG_RETENTION_DAYS', defaultValue: '30', description: 'Log retention period (days)')
string(name: 'SCAN_PATH', defaultValue: '/', description: 'Directory to scan')
booleanParam(name: 'CHECK_ZOMBIES', defaultValue: true, description: 'Enable zombie process detection')
}
stages {
stage('Setup Python Environment') {
steps {
sh 'python3 -m venv venv'
sh './venv/bin/pip install -r requirements.txt'
}
}
stage('Run Monitoring Script') {
steps {
sh '''
source venv/bin/activate
python main.py --threshold ${THRESHOLD} \
--log_retention_days ${LOG_RETENTION_DAYS} \
--scan_path ${SCAN_PATH} \
--check_zombies ${CHECK_ZOMBIES}
'''
}
}
}
post {
always {
cleanWs()
}
}
}