You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/usr/bin/env groovy
  2. pipeline {
  3. agent { label 'GEITENPETRA' }
  4. options { disableConcurrentBuilds() }
  5. stages {
  6. stage('Build') {
  7. steps {
  8. withPythonEnv('System-CPython-3.10') {
  9. withEnv(['DATABASE_USER=django_oscar', 'DATABASE_PASSWORD=django_oscar', 'DATABASE_PORT=5432', 'DATABASE_HOST=localhost']) {
  10. pysh "make install"
  11. }
  12. }
  13. }
  14. }
  15. stage('Lint') {
  16. steps {
  17. withPythonEnv('System-CPython-3.10') {
  18. pysh "make lint"
  19. }
  20. }
  21. }
  22. stage('Test') {
  23. steps {
  24. withPythonEnv('System-CPython-3.10') {
  25. withEnv(['DATABASE_USER=django_oscar', 'DATABASE_PASSWORD=django_oscar', 'DATABASE_PORT=5432', 'DATABASE_HOST=localhost']) {
  26. pysh "make test"
  27. }
  28. }
  29. }
  30. post {
  31. always {
  32. junit allowEmptyResults: true, testResults: '**/nosetests.xml'
  33. }
  34. success {
  35. echo "kek!"
  36. // step([
  37. // $class: 'CoberturaPublisher',
  38. // coberturaReportFile: '**/coverage.xml',
  39. // ])
  40. }
  41. }
  42. }
  43. }
  44. post {
  45. always {
  46. echo 'This will always run'
  47. }
  48. success {
  49. echo 'This will run only if successful'
  50. withPythonEnv('System-CPython-3.10') {
  51. echo 'This will run only if successful'
  52. pysh "version --plugin=wheel -B${env.BUILD_NUMBER} --skip-build"
  53. sh "which git"
  54. sh "git push --tags"
  55. }
  56. }
  57. failure {
  58. emailext subject: "JENKINS-NOTIFICATION: ${currentBuild.currentResult}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}'",
  59. body: '${SCRIPT, template="groovy-text.template"}',
  60. recipientProviders: [culprits(), brokenBuildSuspects(), brokenTestsSuspects()]
  61. }
  62. unstable {
  63. echo 'This will run only if the run was marked as unstable'
  64. }
  65. changed {
  66. echo 'This will run only if the state of the Pipeline has changed'
  67. echo 'For example, if the Pipeline was previously failing but is now successful'
  68. }
  69. }
  70. }