fetched mlz version

- before some chamges in the gerrit pipline

Change-Id: I33eb2d75f83345a7039d0fb709e66defefb1c3e0
This commit is contained in:
2023-05-02 11:31:30 +02:00
parent b19a8c2e5c
commit da15df076a
765 changed files with 35890 additions and 59302 deletions

53
ci/Jenkinsfile vendored
View File

@ -4,7 +4,7 @@ properties([
daysToKeepStr: '',
numToKeepStr: '50')),
parameters([
string(defaultValue: 'sine2020/secop/playground',
string(defaultValue: 'secop/frappy',
description: '', name: 'GERRIT_PROJECT'),
string(defaultValue: 'master',
description: '', name: 'GERRIT_BRANCH'),
@ -13,11 +13,6 @@ properties([
choice(choices: '''\
patchset-created
ref-updated
change-merged''',
description: '', name: 'GERRIT_EVENT'),
choice(choices: '''\
patchset-created
ref-updated
change-merged''',
description: '', name: 'GERRIT_EVENT_TYPE')])
])
@ -30,8 +25,6 @@ def changedFiles = '';
def run_pylint(pyver) {
stage ('pylint-' + pyver) {
def cpylint = "RUNNING"
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
def status = 'OK'
changedFiles = sh returnStdout: true, script: '''\
#!/bin/bash
@ -45,14 +38,14 @@ git diff HEAD~1... --name-only --diff-filter=ARCM -- \\*.py
pip install -r requirements-dev.txt
pip install -r requirements.txt
pip install isort pylint
python3 setup.py develop
pip install -e .
export PYTHONIOENCODING=utf8
echo "$changedFiles"
if [[ -n "$changedFiles" ]]; then
set -o pipefail
pylint $changedFiles | tee pylint_results.txt
isort -df $changedFiles | tee isort_results.txt
isort --df $changedFiles || true | tee isort_results.txt
fi
"""
withCredentials([string(credentialsId: 'GERRITHTTP',
@ -69,16 +62,11 @@ fi
} // credentials
echo "pylint result: $res"
this.verifyresult.put('pylint'+pyver, 1)
cpylint = "SUCCESSFUL"
if ( res != 0 ) {
currentBuild.result='FAILURE'
this.verifyresult.put('pylint'+ pyver, -1)
status = 'FAILURE'
cpylint = "FAILED"
}
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
archiveArtifacts([allowEmptyArchive: true,
artifacts: 'pylint-*.txt'])
recordIssues([enabledForFailure: true,
@ -89,23 +77,17 @@ fi
failedTotalAll: 1])
if (status == 'FAILURE') {
throw new Exception('Failure in pylint with ' + pyver)
}
}
} // run_pylint
def run_tests(pyver) {
stage('Test:' + pyver) {
def cpytest = "RUNNING"
gerritPostCheck(["jenkins:pytest_${pyver}":"RUNNING"])
writeFile file: 'setup.cfg', text: '''
[tool:pytest]
addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
def status = "OK"
verifyresult.put(pyver, 0)
try {
timeout(5) {
sh '''\
@ -113,37 +95,27 @@ addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
. /home/jenkins/secopvenv/bin/activate
pip install -r requirements-dev.txt
pip install -r requirements.txt
python3 setup.py develop
pip install -e .
make test
'''
verifyresult.put(pyver, 1)
cpytest = "SUCCESSFUL"
}
} catch (all) {
currentBuild.result = 'FAILURE'
status = 'FAILURE'
cpytest= "FAILED"
verifyresult.put(pyver, -1)
}
gerritPostCheck(["jenkins:pytest_${pyver}":cpytest])
step([$class: 'JUnitResultArchiver', allowEmptyResults: true,
keepLongStdio: true, testResults: 'pytest.xml'])
if (status == 'FAILURE') {
throw new Exception('Failure in test with ' + pyver)
}
}
}
def run_docs() {
def cdocs = "RUNNING"
gerritPostCheck(["jenkins:docs":cdocs])
stage('prepare') {
sh '''
. /home/jenkins/secopvenv/bin/activate
pip install -r requirements-dev.txt
pip install -r requirements.txt
python3 setup.py develop
pip install -e .
'''
}
@ -185,9 +157,7 @@ def run_docs() {
stage('store html doc for build') {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'doc/_build/html', reportFiles: 'index.html', reportName: 'Built documentation', reportTitles: ''])
cdocs = "SUCCESSFUL"
}
gerritPostCheck(["jenkins:docs":cdocs])
}
@ -219,16 +189,16 @@ node("dockerhost") {
sh '''#!/bin/bash
git worktree add tmpmaster origin/master
cd tmpmaster
docker build --target base --tag secop_base:latest ci
docker build --target docs --tag secop_docs:latest ci
docker build --target base --tag frappy_base:latest ci
docker build --target docs --tag frappy_docs:latest ci
cd ..
rm -rf tmpmaster
'''
}
stage('execute tests') {
def img = docker.image('secop_base:latest')
def docimg = docker.image('secop_docs:latest')
def img = docker.image('frappy_base:latest')
def docimg = docker.image('frappy_docs:latest')
parallel 'Test': {
img.inside {
@ -246,9 +216,10 @@ node("dockerhost") {
if (GERRIT_EVENT_TYPE == 'change-merged')
{
sh '''
rsync -rlv doc/_build/* /ictrlsrv/share/public/doc/secop
rsync -rlv doc/_build/* /ictrlsrv/share/public/doc/frappy
'''
}
}}
}}, failFast: false
}
setGerritReview()
}