问题
I have a build steps like: - ... - npm install - npm start sb:server (start http-server to serve static files) - npm run e2e
By the npm start sb:server; it starts the server and it hangs... and doesn't go the next phase which is npm run e2e.
I would like to add a condition to npm run e2e that it should just start without looking previous phase state (failed or succeeded).
I have checked the https://docs.microsoft.com/en-us/vsts/pipelines/process/conditions?view=vsts#job-status-functions
I can't figure out what kind of command I have to set in 'custom condition' field..
Any help would be appreciated!
回答1:
Every task has a "continue on error" checkbox. Check that. Then, if that task fails, it is treated as a warning, not an error. Execution of subsequent tasks will happen normally.
回答2:
I suspect that the npm start sb:server
must keeps running so that it can be used all the time. So the command is never finished. The workaround is using cmd task to start another cmd task and run the npm start command in new cmd.
来源:https://stackoverflow.com/questions/51302018/vsts-phase-conditions-how-to-continue-with-next-phase