暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. sh 'echo ${WORKSPACE}'
  34. }
  35. }
  36. }
  37. post{
  38. success{
  39. emailext body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}",
  40. recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']],
  41. subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}"
  42. }
  43. always {
  44. deleteDir()
  45. }
  46. cleanup {
  47. cleanWs()
  48. }
  49. }
  50. }