Brak opisu
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.

Jenkinsfile 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. pipeline {
  2. agent any
  3. stages {
  4. stage('Restore packages') {
  5. steps {
  6. sh 'dotnet restore ${WORKSPACE}/RazorApp.csproj'
  7. }
  8. }
  9. stage('Clean') {
  10. steps {
  11. sh 'dotnet clean ${WORKSPACE}/RazorApp.csproj --configuration Release'
  12. }
  13. }
  14. stage('Build') {
  15. steps {
  16. sh 'dotnet build ${WORKSPACE}/RazorApp.csproj --configuration Release --no-restore'
  17. }
  18. }
  19. /*stage('Test') {
  20. steps {
  21. sh 'dotnet test ${WORKSPACE}/RazorApp.csproj --no-restore'
  22. }
  23. }*/
  24. stage('Publish') {
  25. steps {
  26. sh 'dotnet publish ${WORKSPACE} -o out --configuration Release --no-restore'
  27. }
  28. }
  29. stage ('Deploy') {
  30. steps {
  31. sh 'sudo ~/scripts/qa_deploy ${WORKSPACE}/out'
  32. sh '~scripts/push.sh ${WORKSPACE}/out'
  33. }
  34. }
  35. }
  36. post{
  37. success{
  38. emailext body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}",
  39. recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']],
  40. subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}"
  41. }
  42. always {
  43. deleteDir()
  44. }
  45. cleanup {
  46. cleanWs()
  47. }
  48. }
  49. }