-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
51 lines (51 loc) · 1.62 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
40
41
42
43
44
45
46
47
48
49
50
51
pipeline {
agent { label 'master' }
environment {
KUBECONFIG = credentials('a700aafc-b29c-4052-a8f8-c93863709f25')
PATH = "/usr/local/bin:$PATH"
}
stages {
stage('Setup') {
steps {
sh '''#!/bin/bash -ex
# Remove me after testing
python3 -m venv scenario
source scenario/bin/activate
pip install --exists-action i yamllint
pip install --exists-action i flake8
pip install --exists-action i pytest
pip install .
oc version
'''
}
}
stage('Flake8') {
steps {
sh '''#!/bin/bash -ex
source scenario/bin/activate
find . -name *.py | grep -v 'doc' | xargs -i flake8 {} --show-source --max-line-length=120
'''
}
}
stage('Pytest') {
steps {
sh '''#!/bin/bash -ex
source scenario/bin/activate
# export PATH=$PATH:/usr/local/bin/kubectl
ls -l /usr/local/bin
# Patch 3
# Need to document this in Confluence.
# Test Patch 2
# pytest -sv poc_repo/tests/resources/test_ocp_nodes.py
'''
}
}
stage('Cleanup') {
steps {
sh '''#!/bin/bash -ex
rm -rf scenario
'''
}
}
}
}