ci: automate Python tests and clean release artifacts refs #15
This commit is contained in:
@@ -56,6 +56,22 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Python Unit Tests') {
|
||||||
|
steps {
|
||||||
|
dir('pricing-service') {
|
||||||
|
sh '''
|
||||||
|
set -eu
|
||||||
|
export PYTHONPATH=/var/jenkins_home/final-project-python-deps
|
||||||
|
export PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
||||||
|
python3 -m unittest -v test_app
|
||||||
|
|
||||||
|
echo "Python unit tests PASSED"
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Versioned Package') {
|
stage('Versioned Package') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
@@ -63,6 +79,7 @@ pipeline {
|
|||||||
|
|
||||||
VERSION="1.0.${BUILD_NUMBER}"
|
VERSION="1.0.${BUILD_NUMBER}"
|
||||||
|
|
||||||
|
rm -rf dist
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
printf '%s\\n' "$VERSION" > dist/VERSION
|
printf '%s\\n' "$VERSION" > dist/VERSION
|
||||||
git rev-parse HEAD > dist/COMMIT
|
git rev-parse HEAD > dist/COMMIT
|
||||||
|
|||||||
Reference in New Issue
Block a user