blob: 5f63edce7d7e9b5c79e38684b60ec198d1ecf532 (
plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
pipeline {
agent any
triggers {
cron('H */6 * * *')
pollSCM('H */3 * * *')
}
options {
skipDefaultCheckout()
}
environment {
DATA_SRC = "${env.WORKSPACE}/mnt/"
VENV = "${env.WORKSPACE}/amt-jb-venv"
}
stages {
stage('Checkout') {
steps {
checkout scmGit(
branches: [[name: "*/${env.BRANCH_NAME}"]],
extensions: [ cloneOption(shallow: true) ],
userRemoteConfigs: [
[credentialsId: 'abdeb570-b708-44f3-b857-8a6b06ed9822',
url: 'ssh://code.g-r-l.com:6611/panels/amt-jb']
],
)
stash name: 'source', useDefaultExcludes: false
}
}
stage('Python Versions') {
matrix {
axes {
axis {
name 'VER'
values 'python3.14'
}
}
stages {
stage('Setup') {
steps {
dir("amt-jb-${VER}") {
deleteDir()
unstash 'source'
withCredentials([file(
credentialsId: '5cfa9a3a-3c26-499d-832f-0916d524fe05',
variable: 'ENV_TEST_FILE')]) {
sh 'cp $ENV_TEST_FILE .env.test'
}
sh "/usr/local/bin/${VER} -m venv ${VENV}-${VER}"
withCredentials([sshUserPrivateKey(
credentialsId: 'abdeb570-b708-44f3-b857-8a6b06ed9822',
keyFileVariable: 'SSH_PRIVATE_KEY')]) {
sh """
eval \$(ssh-agent) && ssh-add ${SSH_PRIVATE_KEY} && \
${VENV}-${VER}/bin/pip install -r requirements.txt
${VENV}-${VER}/bin/pip install django
"""
}
}
}
}
stage('tests') {
steps {
dir("amt-jb-${VER}") {
sh "${VENV}-${VER}/bin/pytest tests/test_postgres.py -vs"
sh "${VENV}-${VER}/bin/pytest tests/models -vs"
sh "${VENV}-${VER}/bin/pytest tests/managers -vs"
sh "${VENV}-${VER}/bin/pytest tests/http -vs"
}
}
}
}
}
}
}
post {
always {
echo 'One way or another, I have finished'
deleteDir() /* clean up our workspace */
}
}
}
|