-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcicd.jenkinsfile
44 lines (40 loc) · 1022 Bytes
/
cicd.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
40
41
42
43
44
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
echo "Running ${env.BUILD_ID} ${env.BUILD_DISPLAY_NAME} on ${env.NODE_NAME} and JOB ${env.JOB_NAME}"
}
}
stage('List') {
steps{
sh"ls -l ${JENKINS_HOME}"
}
}
stage('Test') {
steps {
echo 'Testing...'
sh'pip install -r ./requirements.txt'
sh"python3 -m pytest ./tests/DBtests.py -r A"
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
sh 'rm -r CI_CD_basics_for_DQE'
sh 'git clone https://github.com/sntikhomirov/CI_CD_basics_for_DQE.git'
sh 'git checkout main'
sh 'git pull'
script {
try {
sh 'git checkout -b "production-W$(date +%W)" main'
} finally {
sh 'git checkout "production-W$(date +%W)"'
sh 'git push origin "production-W$(date +%W)"'
}
}
}
}
}
}