run .net core application with jenkins

时间:2019-05-31 11:38:05

标签: jenkins .net-core continuous-integration

I try to use Jenkins for build and test and want to run my app in the test server. I use pipeline and create this script:

pipeline {
 agent any
 stages {
  stage('Checkout') {
   steps {
    git credentialsId: 'gitUser', url: 'git-url', branch: 'master'
   }
  }
  stage('Restore PACKAGES') {
   steps {
    bat "dotnet restore"
   }
  }
  stage('Clean') {
   steps {
    bat 'dotnet clean'
   }
  }
  stage('Build') {
   steps {
    bat 'dotnet build --configuration Release'
   }
  }
    stage('Run') {
   steps {
    bat 'dotnet run --project "myapp.csproj"'
   }
  }
 }
}

everything is ok but when execute dotnet run pipeline doesn't finish because the application with this command start listening. what can I do run my app with Jenkins?

0 个答案:

没有答案